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/projectnamefolder to your desired project name - Edit the
setup.py:name, url, project_urls, keywords, and entry_pointsto reflect your new project name - Edit the
test_projectname.pyto match your project name.- You will have one
test_filename.pyfile for each file in yoursrcdirectory and you will write tests for the specific file in thetest_filename.pyfile
- You will have one
- Navigate to codecov.io and create a
CODECOV_TOKENproject secret - Install an editable package for development
pip install -e ".[tests]"- add any project requirements to the
setup.py:install_requiresarray
- Run the tests
- VSCode ->
Python: Run All TestsorPython: 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!