8000 [WIP] Make typing and typed-ast external dependencies by gvanrossum · Pull Request #2340 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

[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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
recursive-include lib-typing *.py
recursive-include scripts *
Copy link
Member Author

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.

recursive-exclude scripts myunit
2 changes: 2 additions & 0 deletions build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setuptools
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See commit message.

wheel
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = []
Copy link
Member Author

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.

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,
Expand All @@ -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,
)
3 changes: 2 additions & 1 deletion test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ print('hello, world')
[out]
hello, world

[case testAbstractBaseClasses]
-- Skipped because different typing package versions have different repr()s.
Copy link
Member Author

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?

[case testAbstractBaseClasses-skip]
import re
from typing import Sized, Sequence, Iterator, Iterable, Mapping, AbstractSet

Expand Down
2 changes: 1 addition & 1 deletion typeshed
0