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

Recent bump to 3.7.4.2 fails projects that depend on typing #739

Closed
vkuzmin-uber opened this issue Jul 10, 2020 · 13 comments
Closed

Recent bump to 3.7.4.2 fails projects that depend on typing #739

vkuzmin-uber opened this issue Jul 10, 2020 · 13 comments

Comments

@vkuzmin-uber
Copy link

After recent bump https://github.com/python/typing/blob/master/setup.py we started to see problem:

"ERROR: You need Python 2.7 or 3.4 to install the typing package."

It introduces problem for projects that used py 2.7 and 3.7 if it used "typing" w/o pinned version

@jviebach
Copy link

I'm seeing same error message when installing a package (couchbase-python-sdk) that includes 'typing' in requirements.txt on Py 3.6.10 (AWS Linux/Elastic Beanstalk). Just started after 3.7.4.2 release.

@gvanrossum
Copy link
Member

Does pinning typing to 3.7.4.1 work?

@vkuzmin-uber
Copy link
Author

vkuzmin-uber commented Jul 11, 2020

Yes, as workaround.

I use project Neuropod, that has setup script:

https://github.com/uber/neuropod/blob/master/source/python/setup.py

so, now I need to do the following:

# pin typing version that works with all python versions.
pip install typing=="3.7.4.1"
python .neuropod/source/python/setup.py install

but still, if some version of product is "released', this is broken really. Frankly, I guess we need typing 3.7.4.3 that fixes the issue.

@jviebach
Copy link

jviebach commented Jul 11, 2020

I was also able to pin to 3.7.4.1 to allow containing package to load-- but doing so in Elastic Beanstalk is cumbersome to say the least. Most pip packages load via a requirements.txt file, but since I can't override order of install from a requirements.txt file, I had to create an .ebextension file to install typing before requirements.txt.

`
commands:

07-command:

    command: /opt/python/run/venv/bin/pip install typing==3.7.4.1`

@gvanrossum
Copy link
Member

Why can’t you edit the requirements.txt file to pin the version? (Or for that matter to require typing only for Python 3.4?)

@vkuzmin-uber
Copy link
Author

vkuzmin-uber commented Jul 11, 2020

I can do it for "master" and release a new version of my lib/package. But there are already "released" versions with their dependencies to "typing" w/o pinned version.

It means users of the libraries and packages that has dependencies on "typing", need to upgrade now. And some users just can't upgrade to latest, if they use 2.0 and don't want 3.0 or 3.1 need to produce for them packages with "minor" fix 2.1 now.

@gvanrossum
Copy link
Member

Okay okay I will see what I can do next week. It seems no good deed goes unpunished. :-)

@gvanrossum
Copy link
Member

I have a request though. Can you test that the new version of typing actually works with your app apart from the version checks in setup.py? You should be able to test this by cloning the repo and reverting these two diffs:

  • c850161 (HEAD -> master, tag: 3.7.4.2, origin/master, origin/HEAD) Bump version to 3.7.4.2
  • 0b0e248 Disallow installation on 3.5+

If that doesn't work we'd just be doing the same dance next week.

Same for others who piled on this issue.

@vkuzmin-uber
Copy link
Author

I cannot help much with test. I am not using package in my project. I use Neuropod that uses "typing" for tests as I understand:

https://github.com/uber/neuropod/blob/master/source/python/setup.py

I even uninstall it after "setup" from virtual environment to have no extra dependencies (I don't run tests fo Neuropod in my project and so don't need this dependency).

@vkuzmin-uber vkuzmin-uber changed the title Recent bump to 3.7.4.2 fails projects that depends on typing Recent bump to 3.7.4.2 fails projects that depend on typing Jul 13, 2020
@gvanrossum
Copy link
Member

Well, you claimed to have a workaround that pins the version of typing. Can't you modify that workaround to instead pin a version in a forked version of typing that has the changes I suggested? I don't have access to AWS so I am flying blind here.

@vkuzmin-uber
Copy link
Author

I can confirm that in my case it works, I used this command to pin it:

pip install git+https://github.com/python/typing.git@520d31b0c5616e12b56c05079d86dae5fba3aff0

@gvanrossum
Copy link
Member

Okay, there's now a 3.7.4.3 that's the same as 3.7.4.2 except for the setup.py changes. Can you give it a spin before I close this issue?

https://pypi.org/project/typing/3.7.4.3/ (give PyPI a few minutes to update its cache)

@jviebach
Copy link

It works now for me without work around. Thank you.
Specifics:
Python 3.6.10 installing package 'couchbase-python-client==2.5.12' that includes 'typing' (no pin) as a requirement. Tests pass.

VivekPanyam added a commit to uber/neuropod that referenced this issue Jul 15, 2020
### Summary:

The `typing` module is available within CPython >= 3.5 so we don't need to depend on the pip package.

See python/typing#739 for more details

Note: This PR also modifies some lint scripts to ensure that `setup.py` is covered by the linter.

### Test Plan:

CI
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

3 participants