[CentralOH] Python packaging for PyPI

Andrew Kubera andrewkubera at gmail.com
Wed Dec 7 11:33:12 EST 2016


Of course, I meant `install_requires=` instead of just `requires=`.


> On Dec 7, 2016, at 11:15 AM, Andrew Kubera <andrewkubera at gmail.com> wrote:
> 
> Hi Jay,
> 
> A little test just showed me python requires git to pull directly from a git repository
> (that might be a fun setuptools extension - pure-python implementation of the
> minimum functionality to do a git clone). I think the easiest thing to do is just place
> the Py2D source into your project; I wouldn't usually suggest that, but it hasn't been
> updated in years, and it'd be easier to fix any bugs. Add it to the packages list in the
> setup() function.
> 
> It looks like pygame is uploaded to pypi <https://pypi.python.org/pypi/Pygame> as wheels, so architecture should be handled
> for you (eg: manylinux1_x86_64, win32, win_amd64). I don't know if you need the
> wheel package installed beforehand, but you can ensure it is beforehand by adding it
> to setup_requires=['wheel'], in the setup.py script.
> 
> So the setup.py should have something like:
> 
> setup(
>     name='sandbox',
>     packages=['sandbox', 'Py2D'],
>     setup_requires=['wheel'],
>     requires=['pygame', ...],
>     ...
> )
> 
> I've heard that 'executable' packages should have REQUIREMENTS.txt, and 'library' packages
> should use setup.py to declare dependencies.
> I'm a fan of the setup.py method for everything (keep it DRY).
> 
> Let me know if this works and be sure to share the github repo so we can check out your project
> when its ready!
> 
> - Andrew Kubera
> 
> 
>> On Dec 7, 2016, at 9:43 AM, Jay Shaffstall <jshaffstall at gmail.com <mailto:jshaffstall at gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> I've been writing a physics sandbox (basically a simplified wrapper around Pymunk) for my Intro to Computer Science classes to use for one of their labs.  I'd initially been writing it just for my own use, but have realized it's something that other educators might also be interested in using.  
>> 
>> My plan is to put it on Github and package it so it can be installed using pip.  I have a couple of dependencies, though, that don't easily install using standard pip.  
>> 
>> I wanted to get feedback from those of you who've done this before on the best way of handling those dependencies.
>> 
>> I'll list the dependencies below.
>> 
>> Thanks,
>> Jay
>> 
>> Py2d
>> 
>> This can be installed via pip, but the PyPI version doesn't support Python 3, which my sandbox uses.  The github version does support Python 3.  
>> 
>> If I put the github repo in requirements.txt, can that be installed on machines without git?
>> 
>> Pygame
>> 
>> Which version of pygame needs installed depends on the version of Python they have (both version and 32/64-bit).  I've always had to hunt up a specific version to match what I have installed at the time.  
>> 
>> Is there a best practice for having pygame automatically installed as a dependency if it's not already there?
>> _______________________________________________
>> CentralOH mailing list
>> CentralOH at python.org <mailto:CentralOH at python.org>
>> https://mail.python.org/mailman/listinfo/centraloh
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20161207/b2158c49/attachment-0001.html>


More information about the CentralOH mailing list