You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating this issue for a PR I'd like to submit. Instead of using pipenv, an approach my team and I have been enjoying moreso recently has been to create a make command named refresh-dev that idempotently creates a virtual environment for a developer, compiles all necessary and local dev-oriented requirements from requirements*.in using pip-toolspip-compile command to to generate requirements*.txt files, finally installing Python package dependencies from those files.
Here's a sample of what the our Makefiles look like for each Python-heavy repository we work in:
When the dev first checks out the repo, they'll need to configure the appropriate version of Python for their project. I use pyenv and add a .python-version file at root of repo with the version of Python we're targeting per the context of the project and the context of the eventually production environment.
For example, pyenv shell 3.8.12 will write 3.8.12 in a file named .python-version.
After that, all I or any other dev on the team needs to do is run these commands at the root of their freshly-cloned repo:
make refresh-dev
They may need to manually activate the virtual environment at the end of the process. If they need to add a new dependency, they can simply add the name of the dependency to the appropriate requirements*.in file, then run make pip-compile and pip-sync or make pip-install to refresh their dev environment without having to rebuild it from scratch (although I usually run make refresh-dev just to make sure all packages will work with each other and to start with a clean slate).
The text was updated successfully, but these errors were encountered:
Creating this issue for a PR I'd like to submit. Instead of using pipenv, an approach my team and I have been enjoying moreso recently has been to create a
make
command namedrefresh-dev
that idempotently creates a virtual environment for a developer, compiles all necessary and local dev-oriented requirements fromrequirements*.in
usingpip-tools
pip-compile
command to to generate requirements*.txt files, finally installing Python package dependencies from those files.Here's a sample of what the our Makefiles look like for each Python-heavy repository we work in:
When the dev first checks out the repo, they'll need to configure the appropriate version of Python for their project. I use
pyenv
and add a.python-version
file at root of repo with the version of Python we're targeting per the context of the project and the context of the eventually production environment.For example,
pyenv shell 3.8.12
will write3.8.12
in a file named.python-version
.After that, all I or any other dev on the team needs to do is run these commands at the root of their freshly-cloned repo:
They may need to manually activate the virtual environment at the end of the process. If they need to add a new dependency, they can simply add the name of the dependency to the appropriate
requirements*.in
file, then runmake pip-compile
andpip-sync
ormake pip-install
to refresh their dev environment without having to rebuild it from scratch (although I usually runmake refresh-dev
just to make sure all packages will work with each other and to start with a clean slate).The text was updated successfully, but these errors were encountered: