setuptools and deform

30 views
Skip to first unread message

Tim Tisdall

unread,
Jan 15, 2015, 3:14:58 PM1/15/15
to pylons-...@googlegroups.com
I'm trying to include deform as a dependency in a project and want to pull the latest from github instead of using pypi's version.  However, I'm having some issues.  Here's my really basic setup.py to demonstrate my issue:

from setuptools import setup

setup(
    install_requires=['deform'],
    dependency_links = [
    ]
)

After lots of looking around I figured out the issue was a lack of either a MANIFEST.in or setuptools-git so I'm suggesting the following change: https://github.com/Pylons/deform/pull/257

Basically it adds a setup_requires=['setuptools_git'] if there's a .git directory.



Torsten Irländer

unread,
Jan 16, 2015, 1:12:51 AM1/16/15
to pylons-...@googlegroups.com
If you just want to get the latest version of a given branch you will not need to use the setuptools_git for this:


One drawback seems to be the versioning of the software you fetch from the repo this way. AFAIKS there is no way to get the real version, but can can give a made-up version number like "deform-head" and make this in their own project as requirement.

How does the setuptools_git approach handle this? 

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Tim Tisdall

unread,
Jan 16, 2015, 9:56:59 AM1/16/15
to pylons-...@googlegroups.com
How is the approach at that link different then the code I just posted as having an issue?  I can't see any difference.  The issue is that it does install the package, but because there's no MANIFEST it won't include the templates, css, js, etc...  It only includes the .py files.  `setuptools_git` is a package that generates a MANIFEST based on what files are being tracked by git.  It's intention is so you don't have to manually create and maintain a MANIFEST.

The issue is the approach that you've linked to doesn't provide a working package because none of the Pylons projects have a MANIFEST or some automated way of generating one for you automatically (ie setuptools_git or MANIFEST.in).


--
You received this message because you are subscribed to a topic in the Google Groups "pylons-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pylons-discuss/d9KhI5gNMVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pylons-discus...@googlegroups.com.

Tres Seaver

unread,
Jan 16, 2015, 11:34:01 AM1/16/15
to pylons-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/16/2015 09:56 AM, Tim Tisdall wrote:
> How is the approach at that link different then the code I just posted
> as having an issue? I can't see any difference. The issue is that it
> does install the package, but because there's no MANIFEST it won't
> include the templates, css, js, etc... It only includes the .py
> files. `setuptools_git` is a package that generates a MANIFEST based
> on what files are being tracked by git. It's intention is so you
> don't have to manually create and maintain a MANIFEST.
>
> The issue is the approach that you've linked to doesn't provide a
> working package because none of the Pylons projects have a MANIFEST or
> some automated way of generating one for you automatically (ie
> setuptools_git or MANIFEST.in).

We explicitly don't support *installing* from Github: use PyPI for that.
If you want to track non-released changes, then get a checkout and use
'setup.py develop' (or the equivalent buildout / pip chant): none of
those require `setuptools-git`. Or fork the repo and manage MANIFEST.in
yourself.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlS5PWsACgkQ+gerLs4ltQ6W2wCfdXN/BpSy4pEASbAZo3yl5SRz
K0cAn3HufF1F/OLTK+3ef8NJjaR565Oq
=SEFK
-----END PGP SIGNATURE-----

Tim Tisdall

unread,
Jan 16, 2015, 12:59:20 PM1/16/15
to pylons-...@googlegroups.com
On Fri, Jan 16, 2015 at 11:33 AM, Tres Seaver <tse...@palladion.com> wrote:
We explicitly don't support *installing* from Github:  use PyPI for that.
 If you want to track non-released changes, then get a checkout and use
'setup.py develop' (or the equivalent buildout / pip chant):  none of
those require `setuptools-git`.  Or fork the repo and manage MANIFEST.in
yourself.

Yes, I'm aware of the current policy.  However, the patch I've suggested provides a way for people to allow github installs without adversely affecting those using the PyPi package.

Maybe you don't see it from your end because you're already familiar with how your system is working, but I wasted a good chunk of time trying to figure out why installing from github didn't bring all the necessary files with it.  I'm just trying to suggest incorporating something to prevent further people from wasting time on this same issue.  The arguments against adding setuptools-git across the board was that it was an un-needed requirement for those using PyPi and this circumvents that issue.

Tres Seaver

unread,
Jan 16, 2015, 2:30:37 PM1/16/15
to pylons-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adding a MANIFEST.in without adding the tooling to keep it in sync is not
an improvement for the "normal" usecase: it means that released sdists
will begin accreting "garbage" files (as the unmaintained MANIFEST.in
bitrots).

If you are trying to install a Github-generated tarball of a package
which has PyPI release, you're "holding it wrong", period. If I could
figure out how to turn the Github "releases" feature off, I'd do it in a
heartbeat.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlS5Zs8ACgkQ+gerLs4ltQ4KEwCcCH1Tzx7GV/6PH2AC1Y2Jl50o
fV4An0t+hBgJoYxLqq15oH4D8pSp+Gya
=hJ+e
-----END PGP SIGNATURE-----

Tim Tisdall

unread,
Jan 16, 2015, 3:14:34 PM1/16/15
to pylons-...@googlegroups.com
On Fri, Jan 16, 2015 at 2:30 PM, Tres Seaver <tse...@palladion.com> wrote:
If you are trying to install a Github-generated tarball of a package
which has PyPI release, you're "holding it wrong", period.
 
Yeah, I'm pretty sure my patch wouldn't work in that case since the ".git" directory would be missing...

Since you're further mentioning MANFEST.in I don't think you saw the patch.  It does a "setup_requires=["setuptools_git"]" if there's a .git directory.

Tres Seaver

unread,
Jan 16, 2015, 4:13:49 PM1/16/15
to pylons-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I apologize for misunderstanding you -- I should read more carefully.

I don't see the point of the 'setup_requires' bit: if you are working in
a checkout, you should be using 'python setup.py develop', which Just
Works(TM) without 'setuptools-git'. 'setuptools-git' really only matters
for the *maintainers*, who need to ensure that the non-Python files get
bundled in when they run 'python setup.py sdist' to make a release (we
could subclass the distutils 'sdist' command to barf in the absence of
'setuptools-git', but That-Way-Lies-Madness).


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlS5fvgACgkQ+gerLs4ltQ7ywQCgqL1n2pN4mNazpQ0bq/PYuicO
t14AoKpKjeS/4jRzEC7PlLxuYfOdg953
=L3G+
-----END PGP SIGNATURE-----

Tim Tisdall

unread,
Jan 16, 2015, 4:45:44 PM1/16/15
to pylons-...@googlegroups.com
On Fri, Jan 16, 2015 at 4:13 PM, Tres Seaver <tse...@palladion.com> wrote:
I don't see the point of the 'setup_requires' bit:  if you are working in
a checkout, you should be using 'python setup.py develop', which Just
Works(TM) without 'setuptools-git'.  'setuptools-git' really only matters
for the *maintainers*, who need to ensure that the non-Python files get
bundled in when they run 'python setup.py sdist' to make a release (we
could subclass the distutils 'sdist' command to barf in the absence of
'setuptools-git', but That-Way-Lies-Madness).

Yeah, I see that now.  But before I did see that, I tried including deform via a dependency_link in my setup.py .  Doing that, it fetches the git repo and tries to install via bdist, thus ending up with a non-functional package and it not really being clear as to why.   (The first post shows a smallest-possible-code to demonstrate that)

I totally agree with you, Merickel, and everyone else that people should be either using the PyPi package or installing via a "setup.py develop".  However, most people will probably arrive at this discussion making the same mistakes I did and only after a lot of searching and wasted time.  The patch is to try to avoid other people wasting time the same way I did.
Reply all
Reply to author
Forward
0 new messages