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

[WIP] Make typing and typed-ast external dependencies #2340

Closed
wants to merge 2 commits into from
Closed

Conversation

gvanrossum
Copy link
Member

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

Guido van Rossum added 2 commits October 26, 2016 14:59
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

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.

@@ -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?

@@ -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 [],
Copy link
Member Author

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
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.

@@ -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.

@gvanrossum gvanrossum changed the title Make typing and typed-ast external dependencies [WIP] Make typing and typed-ast external dependencies Oct 26, 2016
@gvanrossum
Copy link
Member Author

I'm withdrawing this. Either I don't understand wheels or pip, or this is not (yet) possible.

@gvanrossum gvanrossum closed this Nov 8, 2016
@gvanrossum
Copy link
Member Author

gvanrossum commented Nov 14, 2016

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)

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

Successfully merging this pull request may close these issues.

1 participant