-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix requirements listings #200
Conversation
Required by pointsets2grid.py but not listed in requirements.
requirements.txt and setup.py inconsistent
- Add dependencies that were missing from setup.py - Generate a requirements.txt using pip-compile
Need to work |
Allows us to use pip-tools while also using PEP508 environment markers and pip-options (e.g. --no-binary for shapely). This file is then referenced in setup.py to avoid duplication.
Above information still holds, except loose dependencies are now held in In short:
|
Tests are failing due to package compatibility with Python versions. Need to add compatible package versions for each supported Python version in requirements.in. Edit: solution is to actually |
- Limit matplotlib version to be compatible with basemap - Add xlrd (required by Andrew's digitised data conversion scripts)
1.19.1 is incompatible with Python 3.5
For consideration, managing hiperseis requirements with pip-tools:
setup.py
andrequirements.txt
are out of sync, withsetup.py
missing quite a few dependencies. Versions inrequirements.txt
are also not pinned.To bring this in line with standards around packaging (install_requires vs requirements files), I've added the missing deps to
setup.py
requirements.in
. I've then usedpip-compile
from pip-tools to generate a pinnedrequirements.txt
file. This gives us a deterministic and replicable dev environment, while maintaining loosest working dependencies for PyPi installs.Install behaviour
pip install -r requirements.txt
will replicate the development environment, but will require hiperseis being added to Python pathpip install -r requirements.txt && pip install .
will replicate the development environment and also install the hiperseis package into the environmentpip install .
will install the hiperseis package, fetching the loosest possible dependencies (i.e. what PyPi install would do and how non-developer users should generally install)(Note for testing you will still need to run
pip install -r tests/requirements.txt
after above install - I haven't looked at synchronising this file andextras_requires
.)Using pip-tools
To use pip tools, install with
pip install pip-tools
. You can then usepip-compile
to generate a fresh list of pinned requirements fromrequirements.in
, which can then be installed withpip install -r requirements.txt
. Add new dependencies/remove old ones from therequirements.in
file (setup.py/install_requires
andrequirements.txt
shouldn't be modified manually when using this approach) and regenerate withpip-compile
when needed.Using pip-tools to upgrade packages
pip-compile --upgrade
will attempt to bump all package versions within the limits set byrequirements.in
- this is handy, especially if part of the CI process, as it allows us to regularly test the latest dependency versions, which gives us a heads up of new dependency versions breaking hiperseis and also getting the latest security updates, bug fixes etc.Supporting different Python versions
Running
pip-compile
with a particular Python version active will generate a compatiblerequirements.txt
for that Python version, based on what's available via pip for that Python version. Currently the committed requirements.txt was generated using Python 3.7 and is not compatible with older versions. To use an older version, such as 3.5, you would have to activate your Python 3.5 environment (with pip-tools installed) and runpip-compile
to generate a new compatible dependency list. This means we need to run pip-compile as part of CI for each different Python version we build and test. It's useful in that it allows us to see the upper limits of what packages we can use given the Python version in use. Alternatively we can generate a requirements file for each version and commit them to the repo.Using pip-tools across Linux/Windows
For packages that have
sys_platform
limitations, pip-compile will either need to be rerun on a Windows platform (currently compiledrequirements.txt
is for Linux) to generate Windows compatible packages, or alternatively we run pip-compile on Linux and Windows, committing both requirements files (e.g.windows_requirements.txt
andlinux_requirements.txt
- see jazzband/pip-tools#585 (comment)).