-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[WIP] Make typing and typed-ast external dependencies #2340
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
recursive-include lib-typing *.py | ||
recursive-include scripts * | ||
recursive-exclude scripts myunit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
setuptools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See commit message. |
||
wheel |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ | |
sys.stderr.write("ERROR: You need Python 3.2 or later to use mypy.\n") | ||
exit(1) | ||
|
||
from distutils.core import setup | ||
from distutils.command.build_py import build_py | ||
from setuptools import setup | ||
from setuptools.command.build_py import build_py | ||
from mypy.version import __version__ | ||
from mypy import git | ||
|
||
|
@@ -94,17 +94,22 @@ def run(self): | |
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Topic :: Software Development', | ||
] | ||
|
||
package_dir = {'mypy': 'mypy'} | ||
if sys.version_info < (3, 5, 0): | ||
package_dir[''] = 'lib-typing/3.2' | ||
|
||
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 commentThe 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. |
||
if sys.platform != 'win32': | ||
install_requires.append('typed-ast >= 0.6.1') | ||
if sys.version_info < (3, 5): | ||
install_requires.append('typing >= 3.5.2') | ||
|
||
setup(name='mypy-lang', | ||
version=version, | ||
description=description, | ||
|
@@ -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 [], | ||
py_modules=[], | ||
packages=['mypy'], | ||
scripts=scripts, | ||
data_files=data_files, | ||
classifiers=classifiers, | ||
cmdclass={'build_py': CustomPythonBuild}, | ||
install_requires=install_requires, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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? |
||
[case testAbstractBaseClasses-skip] | ||
import re | ||
from typing import Sized, Sequence, Iterator, Iterable, Mapping, AbstractSet | ||
|
||
|
+1 −0 | stdlib/2and3/threading.pyi | |
+2 −2 | stdlib/3/concurrent/futures/_base.pyi | |
+20 −1 | stdlib/3/resource.pyi |
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.