Code Monkey home page Code Monkey logo

pkga's Introduction

Introduction

This package is used to debug an issue found with pip-18 and the command --process-dependency-links.

In collaboration with @mmngreco.

Problem description

A non-PyPi package has the following dependencies: - PyPi package (here pip-install-test is a proxy). - Another non-PyPi package (pkgB) which has the same PyPi package as a dependency.

Version specification

Our package (pkgA) requires a greater or equal version of the PyPi package, while pkgB fixes the version of the PyPi package.

Issue

Despite the fact that pkgB fixes a specific version of our PyPi library, pip ignores this fact and goes ahead installing the highest available version of the PyPi package. This creates an unfeasible situation, where pkgB and the PyPi library with an incompatible version coexist in the same environment.

Code snippets

A couple of useful copy-paste lines to reproduce the mistakes

pkga's People

Contributors

kikem avatar

Watchers

 avatar  avatar  avatar

pkga's Issues

Unexpected pip behaviour

Didactic library

This should install numpy==1.14.0 but it doesn't:

classDiagram

pkgA --|> pkgB
pkgA --|> numpy
pkgA : numpy>=1.14.0
pkgA : pkgB

pkgB : numpy==1.14.0
numpy : whatever

conda create -n tst2 python=3.6 pip=18 -y
conda activate tst2

git clone https://github.com/KikeM/pkgA.git
git clone https://github.com/mmngreco/pkgB.git

cat pkgA/setup.py
cat pkgB/setup.py

pip install pkgA/. --process-dependency-links -I --no-cache-dir
pip freeze | grep numpy  # numpy==1.17.1 ??

This should crash installation process but it doesn't with incompatible versions of numpy.

classDiagram

pkgA --|> pkgB
pkgA --|> numpy
pkgA : numpy>=1.14.0
pkgA : pkgB

pkgB : numpy==1.13.0
numpy : whatever

cd pkgA
git checkout crash  # pkgA

cd ../pkgB
git checkout crash  # pkgB
cd ..

cat pkgA/setup.py
cat pkgB/setup.py

pip install pkgA/. --process-dependency-links -I --no-cache-dir
pip freeze | grep numpy  # numpy==1.17.1

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Possible workaround(s)

The best and most direct workaround this dependencies issue is to fork pip and solve it.

Difficulty: Hard.
Scalability: Big.

The second best workaround is to use the tools within pip: pip check.

This tool provides the user with a report on compatibility among the different versions of the installed libraries. Additionally, it sends an integer to the standard error. Therefore, this can provide an easy way to implement an automatic test that guarantees the sanity of the environment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.