简体   繁体   中英

Setting up a project with conda for publishing on Github and PyPi

I'm about to start a project which I believe might become my first project to publish on Github and PyPi, and I'm trying to do this the 'correct' way, but I'm having trouble finding relevant info about this. Maybe the problem is rather that I'm finding too much to read, not sure what advice to follow.

I'm having some troubles understanding how I'm actually supposed to set this up. My understanding is that using Anaconda you are supposed to use conda create -p path/to/place/environment as a replacement for virtualenv. Now, keep in mind that I have never used virtalenv before either, so the concept is a bit fresh for me, but essentially this is for keeping all the work wrapped up in its own bubble, making sure one keep all dependencies for oneself.

So, I'll start with conda create -p ~/projects/myproj . In this folder I will later place the rest of the files of my project. Whenever I'm starting the development of the project, I'll have to make sure to run source activate ~/projects/myproj , correct? From here on, I think I mainly have two questions:

  1. What files created in the environment do I put in my .gitignore, and what files should I commit?
  2. What files are necessary for publishing on PyPi, and should I make sure to keep it in a 'PyPi happy' order from day 1, or are they interesting first when the publishing part actually becomes relevant? Are there stuff in the created conda environment that will conflict with a PyPi upload?

I think this will do for now. If you have any other general advice about keeping the project clean and healthy from get-go, I'll gladly take them!

Your question 1 doesn't make much sense to me. conda create creates the development packages. You should not put them in the same place as your code that your are developing.

As for 2, you just need a setup.py with the standard stuff ( http://python-packaging-user-guide.readthedocs.org/en/latest/ is probably as good of a guide as anything).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM