Steps to install your own library with pip
[Caution] This article is old
The information in this article is out of date and there are some commands that are no longer available. (As of February 4, 2018)
We recommend that you refer to the following articles.
Publish / upload library created in Python to PyPI
Introduction
I registered the library on PyPI for the first time.
So
I will summarize what I did and what I studied.
Referenced site
How to use official setuptools Sample repository
Sample Repository
basic usage of settools
Write package information in setup.py
$ python setup.py sdist
-> Create source package
$ python setup.py install
-> package install
General commands for distribution
Create a PyPI account → PyPy User profile
$ python setup.py test
$ python setup.py register
$ python setup.py sdist bdist_egg upload
$ python setup.py upload_docs
Minimum required? ?? ??
Create a PyPI account → PyPy User profile
$ python setup.py register
$ python setup.py sdist upload
When updating
Change the version of setup.py
$ python setup.py sdist upload
Meaning of arguments of setup () function
- name
- Project name shown on PyPI
- version
- version
- description
- A brief overview of the project. Shown on PyPI
- url
- Project homepage
- author and author_email
- About the creator
- license
- License type
- classifiers
- List of project categorization
- keywords
- Project keywords
- pakages
- A list of packages required for this project. What is a package? Directory
- If you create something under the directory
simpleapi
,
packages = ['simpleapi']
- Also as
from setuptools import setup, find_packages
packages=find_packages(excluede['contrib', 'docs', tests*])
- Can be
-
- Exclude excludes the following directories
- install_requires
- Dependent packages (those that need to be piped in advance)
- package_data
- Additional packages required for the project
- I want to check and write the details later
- data_files
- Additional required files
- script
- Script to run during installation
- entry_points
- I'm not sure. I want to look it up and write it later
- console_scripts
- I'm not sure. I want to look it up and write it later