[PYTHON] How to register a package on PyPI (as of September 2017)

First of all

Even if I googled the method of registering a package on PyPI in a Japanese article, there were many old methods and I could not upload it easily, so I read the guide again and tried the procedure.

https://packaging.python.org/guides/using-testpypi/

This article basically describes the flow when uploading a package. (We do not handle how to write setup.py.)

Upload package in test

--Drop the wheel and twine in advance - pip install wheel twine --Access https://test.pypi.org/ --Register and write down your username and password --Execute the following under the directory where the package you created (there is setup.py) - python setup.py sdist --You should have a dist directory and a compressed file for upload. --Create and place .pypirc

.pypirc


[testpypi]
username: <username>
password: <password>

--Use twine - twine upload --repository-url https://test.pypi.org/legacy/ dist/* --The uploaded library is displayed on My Page of test.pypi.org

When publishing in production

The procedure is almost the same as that at the time of testing, but here are the differences in the procedure at the time of testing.

--Since it will be published on https://pypi.python.org/pypi in production, register on the ← site in advance and make a note of the username and password. --Rewrite pypirc as follows

.pypirc


[pypi]
username: <username>
password: <password>

--When using twine, do not use --repository, just follow the command below. - twine upload dist/*

Recommended Posts

How to register a package on PyPI (as of September 2017)
Register as a package on PyPI
How to register on pypi
Semi-automatically generate a description of the package to be registered on PyPI
How to use Fujifilm X-T3 as a webcam on Ubuntu 20.04
How to create a Conda package
[For beginners] How to register a library created in Python in PyPI
How to deploy a web application on Alibaba Cloud as a freelancer
How to add a package with PyCharm
How to install CatBoost [as of January 2020]
How to install a package using a repository
How to test on a Django-authenticated page
Verification of how to periodically execute a script on a Linux server on Windows
How to calculate the volatility of a brand
How to disguise a ZIP file as a PNG file
A simple example of how to use ArgumentParser
Register as a package on PyPI
Notice the completion of a time-consuming command
How to make a QGIS plugin (package generation)
How to live a decent life on 2017 Windows
[2015/11/19] How to register a service locally using the python SDK on naoqi os
How to access the contents of a Linux disk on a Mac (but read-only)
[Linux] How to read .bashrc of general user as root user on WSL2 Ubuntu20.04
How to read PyPI
A memo of how to use AIST supercomputer ABCI
How to deploy a Django application on Alibaba Cloud
How to install Linux on a 32bit UEFI PC
How to write a list / dictionary type of Python3
A memorandum on how to use keras.preprocessing.image in Keras
How to build a Django (python) environment on docker
How to display DataFrame as a table in Markdown
How to make a Python package using VS Code
I want to install a package of Php Redis
Basics of PyTorch (2) -How to make a neural network-
How to install git on Linux such as EC2
How to run Django on IIS on a Windows server
[Tips] How to use iPhone as webcam on Linux
How to build a Python environment on amazon linux 2
A memo on how to overcome the difficult problem of capturing FX with AI
A Python beginner was addicted to registering his own package on PyPI, February 2017 version
How to use GitHub on a multi-person server without a password
A memo on how to easily prepare a Linux exercise environment
[Linux] How to install a package on a server that does not have a network environment (standalone)
A memorandum to register the library written in Hy in PyPI
How to run a trained transformer model locally on CloudTPU
[Python] How to make a list of character strings character by character
How to build a new python virtual environment on Ubuntu
How to import NoteBook as a module in Jupyter (IPython)
How to shuffle a part of a Python list (at random.shuffle)
How to call a function
How to make a multiplayer online action game on Slack
Get the package version to register with PyPI from Git
How to print characters as a table with Python's print function
How to mount a Windows 10 directory on Ubuntu-Server 20.04 on VMware Workstation 15
A note on how to load a virtual environment in PyCharm
How to use cuML SVC as a Gridsearch CV classifier
How to develop in a virtual environment of Python [Memo]
How to hack a terminal
How to display a list of installable versions with pyenv
[Introduction to AWS] A memorandum of building a web server on AWS
How to get a list of built-in exceptions in python
How to find the scaling factor of a biorthogonal wavelet