Skip to content

Only require 'distro' on linux (as it is linux specific)#3087

Merged
tardyp merged 3 commits intobuildbot:masterfrom
grembo:master
Apr 19, 2017
Merged

Only require 'distro' on linux (as it is linux specific)#3087
tardyp merged 3 commits intobuildbot:masterfrom
grembo:master

Conversation

@grembo
Copy link
Copy Markdown

@grembo grembo commented Mar 28, 2017

This is a trivial/obvious fix.

@mention-bot
Copy link
Copy Markdown

@grembo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tardyp, @sa2ajj and @rutsky to be potential reviewers.

master/setup.py Outdated
'autobahn ' + autobahn_ver,
'PyJWT',
'distro'
'distro;platform_system==="Linux"'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of this construct. Is this supported by all pip/setuptools versions?
Does that work with wheels?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was defined in https://www.python.org/dev/peps/pep-0508/. Based on this post https://discourse.numenta.org/t/setup-py-error-invalid-environment-marker/1298/3 it's supported by:

  • setuptools: 20.2.2 +
  • wheel: 0.24.0 +
  • pip: 8.1.2 +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a much newer version of setuptools than currently required.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is critical, the alternative would be something like

import platform
...
if platform.system() == 'Linux':
    setup_args['install_requires'].append('distro')

If you prefer this, I can update the pull request.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to use a more conservative approach to accomplish the same

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem with that approach is that it does not work with wheels. As I generate the universal wheels on my mac, it wont include distro anymore in the wheels deps.

I would be more in favor of the combination, which would test setup tools version :-/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me an example of what your suggested approach would look like?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import platform
from distutils.version import LooseVersion
import setuptools
...
if LooseVersion(setuptools.version.__version__) >= LooseVersion("20.2.2"):
    setup_args['install_requires'].append('distro;platform_system==="Linux')
elif platform.system() == 'Linux':
    setup_args['install_requires'].append('distro')

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2017

Codecov Report

Merging #3087 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3087   +/-   ##
=======================================
  Coverage   88.29%   88.29%           
=======================================
  Files         314      314           
  Lines       32927    32927           
=======================================
  Hits        29072    29072           
  Misses       3855     3855
Impacted Files Coverage Δ
worker/buildbot_worker/commands/transfer.py 97.74% <0%> (-0.02%) ⬇️
master/buildbot/www/authz/endpointmatchers.py 93.79% <0%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 359311f...cc91178. Read the comment docs.

@tardyp
Copy link
Copy Markdown
Member

tardyp commented Mar 31, 2017

@grembo Hope you don't mind, in order to move faster I did edit your PR last commit to include the proposed change. Let me know if this works for you (and your BSD port)

@grembo
Copy link
Copy Markdown
Author

grembo commented Apr 7, 2017

@tardyp Sorry for the late response, this is ok with me. I'll change/remove the patch to the port on the next release, so it's all good.

@tardyp tardyp closed this Apr 8, 2017
@tardyp tardyp reopened this Apr 8, 2017
@tardyp tardyp merged commit 17cfe5b into buildbot:master Apr 19, 2017
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

Successfully merging this pull request may close these issues.

4 participants