-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
Various requirements fixups #4895
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about or support python < 3.4
?
Are there any other uses for these "markers" that we should support in the future?
Note that the Travis tests are actually passing. The GitHub test status is not getting updated with the new results. |
544dc92
to
ec1f295
Compare
There is a list of markers in PEP 508:
The def format_full_version(info):
version = '{0.major}.{0.minor}.{0.micro}'.format(info)
kind = info.releaselevel
if kind != 'final':
version += kind[0] + str(info.serial)
return version
if hasattr(sys, 'implementation'):
implementation_version = format_full_version(sys.implementation.version)
else:
implementation_version = "0" |
b70f473
to
a2d7a37
Compare
With #4894 not being merged this isn't strictly necessary. And with ST2 v3.3 dropping support for Python 2.7, we won't have to worry as much about Python versions when specifying our dependencies. However, this PR does support a fairly new part of the For instance, while StackStorm doesn't run on macOS, we could at least build the Currently when you try to run Collecting pyinotify
Using cached https://files.pythonhosted.org/packages/e3/c0/fd5b18dde17c1249658521f69598f3252f11d9d7a980c5be8619970646e1/pyinotify-0.9.6.tar.gz
ERROR: Command errored out with exit status 1:
command: .../st2/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ls/_2q7p19s2n1c3xdnphq4btzr0000gn/T/pip-install-ctf42xh_/pyinotify/setup.py'"'"'; __file__='"'"'/private/var/folders/ls/_2q7p19s2n1c3xdnphq4btzr0000gn/T/pip-install-ctf42xh_/pyinotify/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/ls/_2q7p19s2n1c3xdnphq4btzr0000gn/T/pip-install-ctf42xh_/pyinotify/
Complete output (1 lines):
inotify is not available on macosx-10.9-x86_64
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. But if we marked pyinotify==0.9.6 ; platform_system == 'Linux' Then we can at least run Ignoring pyinotify: markers 'sys_platform == "Linux"' don't match your environment |
a2d7a37
to
3aebb17
Compare
Nope, not their bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Expands on the work done in #4750. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@blag This is good stuff. I appreciate the cluster that this type of dependencies can create.
Background
I wanted to specify
python_version < '3.4'
for thesingledispatch
dependency in #4894, but thefixate-requirements.py
script does not support what pip calls "markers". Markers are environment specifications that instruct pip when to install, or more importantly, when not to install a dependency.Here's what a Python version marker would look like for #4894:
That marker would only install the
singledispatch
dependency if installing for Python < v3.4. Thesingledispatch
package is a backport of the same feature for Python 3.4+, available in the standard library in thefunctools
package. So installing it for Python 3.4+ is not necessary.Description
This PR:
fixate-requirements.py
to write out dependency markers if present infixed-requirements.txt
orin-requirements.txt
.Makefile
output to be more readbleAdjusts someMakefile
dependencies so multiplemake
invocations aren't constantly ping-ponging between different versions of pip, setuptools, etc. (read: speeds up the build)fixed-requirements.txt
(in two groups) so it's easier to visually search the file for a dependency by nameFuture Work
I ran
make requirements
after these changes to ensure that the behavior of the script was no different than before. And I will be adding the environment marker to #4894 if this is merged in before that.