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

incremental dev version doesn't work with setuptools #29

Closed
rodrigc opened this issue Mar 14, 2017 · 9 comments
Closed

incremental dev version doesn't work with setuptools #29

rodrigc opened this issue Mar 14, 2017 · 9 comments

Comments

@rodrigc
Copy link
Contributor

rodrigc commented Mar 14, 2017

I tried the following with buildbot in a Python 3 virtual environment:

pip install "git+https://github.com/buildbot/buildbot#subdirectory=pkg"
pip install "git+https://github.com/buildbot/buildbot#subdirectory=master"
pip install "git+https://github.com/buildbot/buildbot#subdirectory=worker"
pip install --upgrade "git+https://github.com/twisted/twisted"

I then ran this command:

buildbot create master

and got this error:

Traceback (most recent call last):
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 654, in _build_master
    ws.require(__requires__)
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 859, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Twisted 17.1.0.dev0 (/Users/crodrigues/my_venv/lib/python3.6/site-packages), Requirement.parse('Twisted>=17.1.0'), {'buildbot'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/crodrigues/my_venv/bin/buildbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3036, in <module>
    @_call_aside
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3020, in _call_aside
    f(*args, **kwargs)
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 656, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 669, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/Users/crodrigues/my_venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 854, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Twisted>=17.1.0' distribution was not found and is required by buildbot

Downgrading to Twisted 17.1.0 then worked.

It looks like the versioning used by incremental doesn't work too well with setuptools.

It is nice to be able to test a trunk version of Twisted against third party code.

@glyph
Copy link
Member

glyph commented Mar 14, 2017

Should we be using .post rather than .dev given the way our release process works?

@hawkowl
Copy link
Member

hawkowl commented Mar 14, 2017

@glyph yeah, I guess a dev comes before a release in setuptools?

@glyph
Copy link
Member

glyph commented Mar 14, 2017

@hawkowl I believe the idea is you update to .dev when you're "working on" the next one.

@tomprince
Copy link

I think it would make more sense to increment the micro version (for twisted, perhaps the minor version) and add .dev.

@rodrigc
Copy link
Contributor Author

rodrigc commented Mar 15, 2017

In https://github.com/twisted/twisted/blob/trunk/src/twisted/_version.py ,
the version is 17.1.0.dev0

This is wrong, since 17.1.0 has already been released.

According to https://www.python.org/dev/peps/pep-0440/#summary-of-permitted-suffixes-and-relative-ordering
_version.py in Twisted should now contain either:

17.1.0.post0 as suggested by @glyph

or

17.2.0.dev0 as suggested by @tomprince

or

*17.1.1.dev0 as suggested by @tomprince

@rodrigc
Copy link
Contributor Author

rodrigc commented Mar 16, 2017

Hmm, incremental throws an exception if you try to use post in _version.py.

  File "setup.py", line 21, in <module>
    setuptools.setup(**_setup["getSetupArgs"]())
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/Users/crodrigues/venv-3.6-2/lib/python3.6/site-packages/setuptools/dist.py", line 318, in __init__
    _Distribution.__init__(self, attrs)
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 281, in __init__
    self.finalize_options()
  File "/Users/crodrigues/venv-3.6-2/lib/python3.6/site-packages/setuptools/dist.py", line 376, in finalize_options
    ep.load()(self, ep.name, value)
  File "/Users/crodrigues/twisted2/.eggs/incremental-16.10.1-py3.6.egg/incremental/__init__.py", line 539, in _get_version
    exec(f.read(), version_file)
  File "<string>", line 10, in <module>
TypeError: __init__() got an unexpected keyword argument 'post'

@rodrigc
Copy link
Contributor Author

rodrigc commented Mar 16, 2017

@hawkowl twisted/twisted#745 ?

According to PEP 440, the relative ordering of suffixes is:

.devN, aN, bN, rcN, <no suffix>, .postN

@hawkowl
Copy link
Member

hawkowl commented Apr 16, 2017

Incremental is missing post... I feel like I should add that.

@glyph
Copy link
Member

glyph commented Oct 4, 2022

I think that adding postrelease support fixed this, so I'm going to call it closed. In any event, the exact series of commands that rodrigc ran in the description now works correctly.

@glyph glyph closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants