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.bat
to setup your global Conda/Python environment. - In a new terminal (Powershell or whatever you prefer),
cd
to the root directory for this project and runinvoke env
to create the Conda development environment. This will create a new Conda environment calledautopack
and 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
autopack
environment by runningconda activate autopack
. - Run
pytest
with 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 build
and wait. The zipped build will be placed in thedist
directory.
- Activate the
autopack
environment 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.toml
file under the[project.dependencies]
or[project.optional-dependencies]
section. See the file for when to use which section. - Run
invoke lock
to update theconda-lock.yml
file with the new dependency.- If you get an error from
conda-lock
, try removing theconda-lock.yml
file and runninginvoke lock
again.
- If you get an error from
- Commit the changes to
pyproject.toml
andconda-lock.yml
to 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.