Skip to content
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

Tidying conda, pip, and setup.py #19

Closed
widdowquinn opened this issue Dec 3, 2020 · 0 comments · Fixed by #20
Closed

Tidying conda, pip, and setup.py #19

widdowquinn opened this issue Dec 3, 2020 · 0 comments · Fixed by #20
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@widdowquinn
Copy link
Collaborator

  1. The requirements in the three dependency lists do not currently agree with each other.

The conda and pip package managers do not overlap exactly. Some packages are available only in pip and others only in conda/bioconda. The repository contains an environment.yml for conda and a requirements.txt for pip. Additionally, the setup.py file will install biopython and pandas.

These three descriptions of code requirements should - ideally - agree, but do not:

  • setup.py pins biopython at >= 1.76 and pandas at >= 1.0.3
  • requirements.txt does not specify any versions
  • environment.yml pins biopython at 1.78, and pandas at 1.1.2

If packages are to be pinned, they should really be pinned at the same versions, unless there is some specific intent otherwise (and this should be flagged). It is fine to have a specific intent (e.g. environment.yml specifies a very detailed known good environment, but that may be overkill, here)

  1. The requirements could be organised differently - and possibly be more easily maintained.

The setup.py file should state which packages are necessary to run, in the install_requires argument, though setuptools does not make any attempt to ensure that the installed packages are mutually compatible. Any version pins here should perhaps take their lead from a known good configuration?

The environment.yml file only works with conda, but it does allow version pinning and also installation of pip-specific packages. The current environment.yml appears to be autogenerated (hence the very specific pins) and includes many packages that are implied dependencies of the required packages. The environment.yml file could be trimmed down considerably to contain only those packages that are necessary to run the script/module (and these then imply the other dependencies). Any pip-only modules can be specified here under a pip field.

The requirements.txt file mixes dependencies necessary for the module/script with those that are required only for development. These could be split into separate requirements.txt (corresponding to install_requires from setup.py and requirements-dev.txt files, so that packages which are not required for the module/script are not installed unnecessarily.

  1. The installation instructions can then be streamlined, and separate instructions given for those who are only using, and those who are also maintaining/developing, the tool.

The four routes for a user should be something like:

  • python setup.py install (takes dependencies from setup.py's install_requires
  • conda env create --file environment.yml (takes dependencies from environment.yml and optionally other pip-specific requirements files
  • conda install --file requirements.txt
  • pip install -r requirements.txt

then for a developer/maintainer

  • conda install --file requirements-dev.txt
  • pip install -r requirements-dev.txt

(then pip install -e .)
are good options for installing things like flake8/pylint etc.

  1. Some necessary modules were missing from one or more dependency definition:
  • requests
  • mechanicalsoup
  • pyyaml
  • tqdm
@widdowquinn widdowquinn self-assigned this Dec 3, 2020
@widdowquinn widdowquinn added bug Something isn't working documentation Improvements or additions to documentation labels Dec 3, 2020
widdowquinn pushed a commit that referenced this issue Dec 3, 2020
This commit updates requirements.txt, setup.py and environment.yml
files so that the use of any should complete script/module setup.
@widdowquinn widdowquinn linked a pull request Dec 3, 2020 that will close this issue
widdowquinn pushed a commit that referenced this issue Dec 3, 2020
This commit updates requirements.txt, setup.py and environment.yml
files so that the use of any should complete script/module setup.
HobnobMancer added a commit that referenced this issue Dec 7, 2020
fix issue #19 - inconsistent dependency definitions
widdowquinn pushed a commit that referenced this issue Dec 7, 2020
This will probably clash with #19 so will need fixed at merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant