-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[WIP] Make typing and typed-ast external dependencies #2340
Conversation
This will automatically install the typing and typed-ast packages when appropriate. The setup.py file now depends on setuptools. We should build wheels so that users installing from PyPI won't need setuptools. In order to build wheels the distribution builder/uploader needs to install the wheel package. To manage those dependencies, I've added build-requirements.txt. In summary: - python3 -m pip install -r build-requirements.txt - python3 setup.py bdist_wheel - upload the .whl file that appears in the dist/ subdirectory to PyPI
…cific typing package
|
||
scripts = ['scripts/mypy', 'scripts/stubgen'] | ||
if os.name == 'nt': | ||
scripts.append('scripts/mypy.bat') | ||
|
||
install_requires = [] |
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.
Actually I think dynamic construction of this variable is wrong. I tried to use the environment markers syntax for these but that didn't seem to work correctly either. I'll have to improve this through trial and error.
@@ -11,7 +11,8 @@ print('hello, world') | |||
[out] | |||
hello, world | |||
|
|||
[case testAbstractBaseClasses] | |||
-- Skipped because different typing package versions have different repr()s. |
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.
That's a side effect of installing the typing package from PyPI. Previously we always used the one from lib-typing/3.2, which is more recent than typing 3.5.2 from pypi. Somehow the test passed in Travis-CI on Python 3.5, which makes me wonder whether Travis is using a 3.5.3 prerelease or whether I've missed the 3.5.3 release?
@@ -115,10 +120,11 @@ def run(self): | |||
license='MIT License', | |||
platforms=['POSIX'], | |||
package_dir=package_dir, | |||
py_modules=['typing'] if sys.version_info < (3, 5, 0) else [], |
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 wish I could remove lib-typing completely, but it's used by some tests still.
@@ -1,3 +1,2 @@ | |||
recursive-include lib-typing *.py |
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.
This omits it from the package we upload to PyPI. It's still in the repo.
@@ -0,0 +1,2 @@ | |||
setuptools |
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.
See commit message.
I'm withdrawing this. Either I don't understand wheels or pip, or this is not (yet) possible. |
Reopening. I've figured out some extra magic to be put in setup.cfg. The typing dependency is now correctly version-dependent. However the installed scripts (mypy, stubgen) have the Python version used to create the wheel file hard-coded, so I'll have to do some more digging. There's also the problem that I'm getting warnings about the version being invalid. (Actually it's a new PR: #2452) |
This will automatically install the typing and typed-ast packages when
appropriate.
The setup.py file now depends on setuptools. We should build wheels
so that users installing from PyPI won't need setuptools. In order to
build wheels the distribution builder/uploader needs to install the
wheel package. To manage those dependencies, I've added
build-requirements.txt.
In summary: