USEPA / LCIAformatter

MIT License
24 stars 9 forks source link

ResolutionImpossibleError: lciafmt and electricitylci depend on different patch versions of fedelemflow list #82

Closed dt-woods closed 2 years ago

dt-woods commented 2 years ago

FYI: the latest versions of lciafmt (v1.0.3) and electricitylci (v.1.0.1) have a conflicting (and impossible to resolve using setup.py and requirements.txt) dependencies on fedelemflowlist. This is likely caused by severe numbering in the requirements of these individual packages. Typically bug fixes (i.e., patch numbers from Backus-Naur Form Grammar as recommended by GitHub) don't cause backwards compatibility issues and, as such, probably need not be explicitly defined as a requirement; after all, it shouldn't break API functionality. Unfortunately, this breaks software installations that depend on these packages and the only solution (that I know of) is to manually install these packages one at a time allowing old dependencies to be uninstalled and new dependencies to be installed. It is my recommendation that ranges be used or specific patch fixes be removed from software release requirements in future releases.

To reproduce the error, create a new Python virtual environment and create a requirements.txt file with:

git+https://github.com/USEPA/LCIAformatter.git#egg=lciafmt
git+https://github.com/USEPA/ElectricityLCI#egg=electricitylci

The following error is encountered (using Python 3.9.10).

INFO: pip is looking at multiple versions of lciafmt to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 1) and -r requirements.txt (line 2) because these package versions have conflicting dependencies.

The conflict is caused by:
    lciafmt 1.0.3 depends on fedelemflowlist 1.0.8 (from git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist)
    electricitylci 1.0.1 depends on fedelemflowlist 1.0.2 (from git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List@v1.0.2#egg=fedelemflowlist)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
bl-young commented 2 years ago

see my comment here - I believe this is an issue due to how the requirements of elci are specified and would recommend dropping the fedefl version requirement there.

We no longer specify specific version requirements for LCA Tool ecosystem packages but do integration testing across them to ensure that the latest releases are compatible