-
Notifications
You must be signed in to change notification settings - Fork 772
Environment markers #357
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
Environment markers #357
Conversation
setup.py
Outdated
# Environment markers | ||
extras_require = { | ||
# Older versions of pip don't support operators other than ==/!= | ||
":python_version=='2.6'": REQUIRES_PY2, |
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.
Does
":python_version =='2.6' or :python_version='2.7'": REQUIRES_PY2,
not work?
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.
Never tried, I will change if it works after I tried using or
operator.
setup.py
Outdated
# Older versions of pip don't support operators other than ==/!= | ||
":python_version=='2.6'": REQUIRES_PY2, | ||
":python_version=='2.7'": REQUIRES_PY2, | ||
":python_version!='2.6' and python_version!='2.7'": REQUIRES_PY3, |
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.
I'd rather be explicit about the specific versions of 3 we support, because we do not currently state that we support anything below 3.3, which your environment marker currently does include.
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.
Environment markers doesn't mean to support nor to unsupport Python versions what they're about. As like it doesn't mean to support Python 2.5, doesn't mean support Python 3.2. 😀
However, I would append and python_version!='3.0' and python_version!='3.1' and python!='3.2'
to it if you advise to do that. 😜
REQUIRES.extend(["cryptography >= 1.3.4", "idna >= 2.0.0", "pyOpenSSL >= 0.14"]) | ||
if sys.version_info >= (3, 0): | ||
REQUIRES.append('pysocks') | ||
if 'bdist_wheel' not in sys.argv: |
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.
When is this if statement used and the environment markers are not used such that this block is necessary?
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.
It's used when an older version of pip
installs twilio sdist.
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 you know what versions of pip
need this block? Maybe we can remove it if those versions of pip
are sufficiently old?
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.
I'm unsure about that, but as far as I remember pip
installed on Ubuntu LTS versions didn't work well without this.
Adjusted things @ilanbiala pointed. Thanks! |
@dahlia thanks for the changes and explanation. I actually think it might be better to just say:
I'm not sure though if the |
d95a2e7
to
ed8dd30
Compare
@ilanbiala Got it. Amended! |
@dahlia LGTM, can you squash down to 1 commit? |
@ilanbiala Should I squash all 5 commits into one? GitHub supports squash merging of pull requests. |
Oh thanks pointing that out, I didn't know GitHub added that. |
ed8dd30
to
09ce75f
Compare
To resolve conflict with the current |
Are there anything I should do more to merge this? Or it's ready but waiting for the next release? |
@dahlia It's ready, and we're including it in the next release. Thanks for submitting the fix and following up! |
The only problem with this code is it breaks when Python 3.7 is released. I think the old version tests made more sense so that it included |
@tisdall can you clarify how it would break when Python 3.7 is released? Are you referring to just missing the python_version for pysocks for it? Also, where are there talks about Python 4? |
Python 3.7 won't match any of the extras_require statements so none of REQUIRES_PY3 will be included (which right now is just pysocks). I haven't investigated whether pysocks is necessary for py3.7, but I'm assuming it is.
Okay, I'm probably wrong about py4, please disregard that part. |
@tisdall Right, but we can just add |
@ilanbiala - You can, but I think what @dahlia had before would mean that wouldn't be necessary: I guess it's not a big deal, it's just one less thing to worry about when new versions of python are added. |
This patch aims to fix #356 and some related others.
if
conditions on setup.py still remains if it's not building wheels.<
/>=
, it uses only==
/!=
/and
for backward compatibility.Dependencies of build wheels now look like (
"run_requires"
field of twilio-6.3.0.dist-info/metadata.json):