UGRC's default Python project configuration/template
- Create new environment for the project
- With python 3 (without arcpy)
python -m venv .env
- activate the environment
source .env/bin/activate
- With conda
conda create --name PROJECT_NAME python=3.7
- With python 3 (without arcpy)
- Rename
src/projectname
folder to your desired project name - Edit the
setup.py:name, url, project_urls, keywords, and entry_points
to reflect your new project name - Edit the
test_projectname.py
to match your project name.- You will have one
test_filename.py
file for each file in yoursrc
directory and you will write tests for the specific file in thetest_filename.py
file
- You will have one
- Navigate to codecov.io and create a
CODECOV_TOKEN
project secret - Install an editable package for development
pip install -e ".[tests]"
- add any project requirements to the
setup.py:install_requires
array
- Run the tests
- VSCode ->
Python: Run All Tests
orPython: Debug All Tests
ptw
- Pytest Watch will restart the tests every time you save a file
- VSCode ->
- Bring your test code coverage to 80% or above!