-
Notifications
You must be signed in to change notification settings - Fork 7
CreatePythonProject
PyKern automates the creation of a Python module or library that will be ready for use with PyPI, Read The Docs and related services.
Here are simplified instructions, which only work for RadiaSoft projects.
First, create a RadiaSoft GitHub repository with no files. I've used rssynergia
as an example. Assuming you are in a RadiaSoft VM (or in any unix-like environment where PyKern is properly installed), do the following (or equivalent, using the name of your repository and an appropriate description):
cd ~/src/radiasoft/
git clone https://github.com/radiasoft/rsfriction
cd rsfriction
pykern projex init-rs-tree 'Python library for simulating the dynamical friction force exerted on ions by magnetized electrons'
git commit -am 'initial setup'
git push
python setup.py develop
One can also work with a non-RadiaSoft repository, but the argument "init_rs_tree" must be changed to "init_tree" and then several string arguments must be supplied.
Helpful hints can be obtained from
pykern projex -h
However, you may also want to look at the source code for projex.py.
When you setup PyPI, you should start with the
test site. The packages should be registered
with the builder
user. First click on Package submission
on the left side:
Then upload the PKG-INFO
file that was created by pykern setup.py develop
.
It's located in, e.g. ~/src/radiasoft/rssynergia/rssynergia.egg-info/PKG-INFO
:
At this point testpypi is ready to go.
To compile the documentation on ReadTheDocs, you'll need to import the project.
Go to
ReadTheDocs Dashboard and click on
Import a Project
:
This will show you a list of repositories, click on the [+]
next to the
repository you want to import:
Select the Edit advanced project options and click Next:
Enter a description. Select Python Programming Language. Fill in Project homepage to GitHub repo URL. Then click Finish:
Click on Admin button and then Advanced Settings (on the left):
DO NOT Install your project inside a virtualenv
.
Set the Default Version to latest
.
Finally, click Submit.
You may want to edit docs/index.rst
with a longer description.