question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consolidate files listing dependencies

See original GitHub issue

Currently, the following files all list torchgeo’s dependencies:

  • setup.cfg
  • requirements.txt
  • docs/requirements.txt
  • spack.yaml
  • environment.yml
  • .github/workflows/{docs/release/style/tests}.yaml
  • .pre-commit-config.yaml

Whenever someone needs to add a new dependency to torchgeo, they need to add it to most of these files, making it easy to forget and difficult to keep track of. We should try to consolidate these. Here are some suggestions:

setup.cfg

We may be able to use requirements.txt instead of setup.cfg by using something like pbr or setuptools-scm. But see below for another option.

requirements.txt

I don’t think this file is necessary. pip install .[all] in the root directory should read the dependencies from setup.cfg and provide much of the same support as pip install -r requirements.txt. I think pip install git+https://github.com/microsoft/torchgeo may also work.

docs/requirements.txt

This can be removed pending https://github.com/pytorch/pytorch_sphinx_theme/issues/143

spack.yaml

This can be removed by adding a py-torchgeo package to Spack. It can install both stable releases (once we release) as well as development versions.

environment.yml

I’m not sure how to remove this one. Can conda-forge be used to install development versions?

.github/workflows/{docs/release/style/tests}.yaml

If we pip install all of our dependencies from requirements.txt, it will be slower than only installing the deps for a specific tests, but we won’t have to duplicate info as much.

.pre-commit-config.yaml

No ideas, the developers don’t seem interested in sharing configuration files with any other tool: https://github.com/pre-commit/pre-commit/issues/1165

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
adamjstewartcommented, Sep 19, 2021

Gotcha. I think a lot of developers (especially @calebrob6) prefer conda. Personally I use Spack. And a lot of people just want to use pip. I think supporting more package managers than that would add more headaches.

1reaction
ashnair1commented, Sep 19, 2021

Perhaps better is too strong a word. Convenient would be more appropriate. Poetry doesn’t replace conda. conda manages environments and resolves dependencies whereas poetry only does the latter. The key here is how a project uses conda. Is it used for environment management? Installing specific non-python libraries? Both?

I mainly used conda for environment management and I preferred poetry because:

  • Manual update and maintenance of environment.yml With conda I needed to maintain an environment.yml file and had to manually update it for every package I added. With poetry I can keep adding dependencies via poetry add which updates pyproject.toml and the poetry.lock file (for transitive dependencies) and go about my work. Also one less file for me to maintain.

  • conda is generally slower. This isn’t a knock against conda since it’s scope extends beyond python and python packages. But due to this, it takes a while for dependencies to be resolved. poetry is a dependency manager for python and I’ve found it to be faster to set up an environment when I work with python projects.

Misc issues:

  • Need to keep track of conda-forge and pypi versions.
  • Cross platform environments

Poetry and pyenv together gives me enough environment management without the overhead of maintaining an additional file of dependencies and tracking a separate package registry (conda-forge). Here I prefer to use two specialised tools over a single massive one.

That being said, for projects that utilise non-python libraries (like GDAL for example), I would still use conda.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven: How to consolidate Manifest information from ...
I have a Mavenized war module which depends on other Mavenized dependencies. Each will come with its own version. However, I wish to...
Read more >
Consolidate Multiple Manage Packages With Dependency?
Let's list down pros and cons. Pros of using multiple packages and dependencies. Application design is modular; In future if the application ...
Read more >
The Manage Project Menu - Max 7 Documentation
Consolidate : Consolidate copies all explicit project members and their dependencies to the Project's folder. All files are "localized", meaning that the ...
Read more >
Makefiles use compiler for dependencies
The compiler is used to generate implicit dependencies. The dependencies are consolidated, per target, in a dedicated file. Checking pipeline status.
Read more >
Merge request dependencies - GitLab Docs
Merge request dependencies. premium · Ensure changes to a required library are merged before changes to a project that imports the library. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found