Skip to content

Conversation

@nsoranzo
Copy link
Contributor

See https://hynek.me/articles/conditional-python-dependencies/ for a background explanation.

The fallback for setuptools < 18 is inspired by https://gitlab.com/pycqa/flake8/blob/master/setup.py

@nsoranzo nsoranzo requested a review from tleonhardt as a code owner March 27, 2018 12:58
@codecov
Copy link

codecov bot commented Mar 27, 2018

Codecov Report

Merging #330 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #330   +/-   ##
=======================================
  Coverage   91.01%   91.01%           
=======================================
  Files           1        1           
  Lines        1636     1636           
=======================================
  Hits         1489     1489           
  Misses        147      147

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6005458...7c444e8. Read the comment docs.

Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

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

Thanks for the PR Nicola!

It looks good to me, but I'm relatively ignorant of the new setuptools features. We will make sure they work OK when it comes time for the next release.

I don't think we normally release as a wheel, though I'm honestly not sure ...

# Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
if sys.version_info < (3, 5):
INSTALL_REQUIRES += ['contextlib2']
EXTRAS_REQUIRE = {
Copy link
Member

Choose a reason for hiding this comment

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

I wasn't familiar with this syntax within setuptools for conditional dependencies.

@tleonhardt tleonhardt merged commit 28c89a5 into python-cmd2:master Mar 27, 2018
@nsoranzo
Copy link
Contributor Author

@tleonhardt Thanks for the merge!

I don't think we normally release as a wheel, though I'm honestly not sure ...

Unfortunately not yet: https://pypi.python.org/pypi/cmd2

It is very simply and you can easily automate it with a Makefile:

$ python setup.py sdist
$ python setup.py bdist_wheel
$ twine upload dist/*

You just need recent versions of pip, setuptools, twine and wheel installed.

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.

2 participants