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

Better packaging #15

Closed
webknjaz opened this issue May 3, 2017 · 6 comments
Closed

Better packaging #15

webknjaz opened this issue May 3, 2017 · 6 comments

Comments

@webknjaz
Copy link
Contributor

webknjaz commented May 3, 2017

Hi,

There's a few ways of improving this distribution package:

  • integrate setuptools_scm into setup.py to enable version guessing via git tag — you'll never need to hardcode the version in Python files;
  • enable automatic deployment of the package to PYPI via TravisCI on git tag created.

Would you accept my help with this?

@amol-
Copy link
Owner

amol- commented Jul 14, 2017

automatic release to PyPi through travis seems a good idea, but I'm a bit concerned by setuptools_scm. As it's a setup_requires does it mean that every person that installs the package through sources will need it?

@webknjaz
Copy link
Contributor Author

It's handled automatically by setuptools+pip

@amol-
Copy link
Owner

amol- commented Jul 15, 2017

Well that's the purpose of setup_requires but one of the foundations of dukpy is to keep its install phase dependencies less ( no libraries required apart cpython ) and I would really prefer to avoid adding one just for that.

It would make more sense to have something that does that at sdist phase instead of doing that on PC on user installing the package

@webknjaz
Copy link
Contributor Author

Well, I need to check this, because it is not listed among downloaded packages when I spawn pip install. It was just my guess.

@webknjaz
Copy link
Contributor Author

@amol- alright, I've checked this on the Internet and tested with pip install command and now I'm sure that this is a dependency only for the build environment.

@amol-
Copy link
Owner

amol- commented Jul 16, 2017

Note that you won't see the downloaded package because it's not downloaded by pip as a dependency, it's actually downloaded by setuptools when egg_info is performed by pip to install it. Also it's downloaded in .eggs so it's not visibile by default.

You will notice that if you run:

$ pip install sshuttle -v --no-cache-dir --no-clean --no-binary :all:

And you stop it (CTRL+Z) right after Running setup.py (path:/tmp/pip-build-Gzd6Su/sshuttle/setup.py) egg_info for package sshuttle phrase (I'm not aware of any way to prevent pip from deleting the packages build dir after it installs them) you will find setuptools_scm in /tmp/pip-build-Gzd6Su/sshuttle/.eggs which means that setuptools downloaded the package through easy_install and made it available to the setup phase.

99% of the times this won't be an issue, especially since people will install wheels, but I'm not sure it makes sense to face the 1% issues just to avoid the effort of manually updating the version :D

Kajiki for example achieves a similar result through https://github.com/nandoflorestan/kajiki/blob/master/release_new_version.py which takes care of tagging the repository and setting the version automatically without the need to extend the setup script.

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

No branches or pull requests

2 participants