I'm doing it on Windows, but I got stuck on some, so make a note
Create setup.py in the project and describe it. I think that a lot of detailed description contents will come out if you google with python setup.py, so refer to that. Classfiers must be selected and described from here. Also, setup.py can be written using distutils and setuptools, but it seems that the writing method using setuptools is newer, so it is recommended to write it in setuptools.
After writing setup.py
python setup.py register
Execute the command. People who have never registered with pypi will get the following message, so select 2 and register as a user with pypi.
We need to know who you are, so please choose either:
1. use your existing login,
2. register as a new user,
3. have the server generate a new password for you (and email it to you), or
4. quit
If the registration is successful, you will receive an email, so follow the link from there to complete the registration.
Probably .pypirc is not created on Windows, so create .pypirc in the HOME directory specified by the environment variable and write the following.
[pypirc]
servers = pypi
[server-login]
username: <Registered user name>
password: <Registered password>
Execute the following command again to register the package with pypi.
python setup.py register
Hit the following command to upload the package to pypi
python setup.py sdist upload -r pypi
I don't know if it will take a while, but it may not come out even if you search with pypi, you can check it immediately with pip.
pip install <package name>
If you can install it with, it is completed.
Recommended Posts