pyproject.toml: project metadata and abstract dependencies used to build the project and install development environment.conda-lock.yml: locked dependencies for conda, generated frompyproject.toml. Enables reproducible builds and development environments.tasks.py: automation tasks for building, testing, and releasing the project. See invoke for more information.
Want to make a change? Terrific!
All steps involving terminal commands below assume that you are in the root directory of the project, i.e. that you have run cd <somewhere-on-your-computer>/autopack.
The project uses Conda to manage the development environment and its dependencies. Additionally, the conda-lock and invoke packages need to be installed in the base environment. Luckily, there's a script that will do all of this for you, and you should only need to do it once. Just follow the steps below:
- Run
bin/setup-global-environment.batto setup your global Conda/Python environment. - In a new terminal (Powershell or whatever you prefer),
cdto the root directory for this project and runinvoke envto create the Conda development environment. This will create a new Conda environment calledautopackand install all dependencies. - Code away, and see below for instructions on more specific tasks.
All instructions below assume you have an installed development environment.
- Run
invoke test.
or...
- Activate the
autopackenvironment by runningconda activate autopack. - Run
pytestwith your preferred options.
- Run
invoke app.
This will be done automatically by the CI/CD pipeline, but if you want to do it locally, follow these steps:
- Run
invoke buildand wait. The zipped build will be placed in thedistdirectory.
- Activate the
autopackenvironment by runningconda activate autopack. - Doodle around with
conda install <package>(orpip install <package>if needed) until you get what you want. - Add the package to the
pyproject.tomlfile under the[project.dependencies]or[project.optional-dependencies]section. See the file for when to use which section. - Run
invoke lockto update theconda-lock.ymlfile with the new dependency.- If you get an error from
conda-lock, try removing theconda-lock.ymlfile and runninginvoke lockagain.
- If you get an error from
- Commit the changes to
pyproject.tomlandconda-lock.ymlto source control. This will make sure that everyone on the project can install the exact same dependencies, and give us traceability for when things break.