Giter Site home page Giter Site logo

Seems it's broken about plugincompat HOT 4 CLOSED

pytest-dev avatar pytest-dev commented on June 7, 2024
Seems it's broken

from plugincompat.

Comments (4)

nicoddemus avatar nicoddemus commented on June 7, 2024

Oh, many thanks for reporting this. It was working without a glitch for a while, so it would take me a while to realize it was not working correctly. 😄

from plugincompat.

nicoddemus avatar nicoddemus commented on June 7, 2024

Hey,

I did take a look at the problem, but it seems the solution is more complicated than I thought, seems to be a problem on how tox handles the --force-dep option. This might take awhile.

Thanks again for the report! 😄

from plugincompat.

ionelmc avatar ionelmc commented on June 7, 2024

Can you elaborate on what's the problem? --force-dep doesn't seem related to that weird error about requirements.txt

from plugincompat.

nicoddemus avatar nicoddemus commented on June 7, 2024

Sure!

From the stack trace:

File "/home/travis/virtualenv/python2.7.9/src/tox/tox/_config.py", line 374, in _makeenvconfig
    name = self._replace_forced_dep(name, config)
  File "/home/travis/virtualenv/python2.7.9/src/tox/tox/_config.py", line 432, in _replace_forced_dep
    if self._is_same_dep(forced_dep, name):
  File "/home/travis/virtualenv/python2.7.9/src/tox/tox/_config.py", line 443, in _is_same_dep
    dep2_name = pkg_resources.Requirement.parse(dep2).project_name

The problem lies in constructing the pkg_resources.Requirement.parse object, which is used when the --force-dep option is passed. This happens when a plugin lists its dependencies using a requirements.txt file like this:

[testenv]
deps = -r{toxinidir}/requirements-testing.txt

Instead of defining them explicitly:

[testenv]
deps = foo==1.0
   bar>1.2

In this case "-r /path/to/requirements.txt" is being passed instead of a project version requirement to pkg_resources.Requirement.parse. I didn't looked in the problem too deeply, but it seems like tox in the normal workflow just forwards deps to pip install machinery, but when the --force-dep option is passed it actually tries to parse dependencies to find the one to substitute versions and breaks. And that is my fault as I wrote support for --force-dep. 😄

The correct solution would be to parse the requirements (using pkg_resources), but hadn't have time to look at it yet as I was on vacation. But I will try to get to this next week.

Cheers,

from plugincompat.

Related Issues (20)

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.