Skip to content

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

Closed
gvanrossum wants to merge 2 commits into
masterfrom
reqs
Closed

gvanrossum wants to merge 2 commits into
masterfrom
reqs

Conversation

@gvanrossum

Copy link
Copy Markdown
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
Comment thread setup.py
if os.name == 'nt':
scripts.append('scripts/mypy.bat')

install_requires = []

Copy link
Copy Markdown
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.

hello, world

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

Copy link
Copy Markdown
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?

Comment thread setup.py
license='MIT License',
platforms=['POSIX'],
package_dir=package_dir,
py_modules=['typing'] if sys.version_info < (3, 5, 0) else [],

Copy link
Copy Markdown
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.

Comment thread MANIFEST.in
@@ -1,3 +1,2 @@
recursive-include lib-typing *.py

Copy link
Copy Markdown
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.

Comment thread build-requirements.txt
@@ -0,0 +1,2 @@
setuptools

Copy link
Copy Markdown
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
Copy Markdown
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

gvanrossum commented Nov 14, 2016 •

Copy link
Copy Markdown
Member Author

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