publishing a python library

fukurou

the supreme coder
ADMIN
create a .pypirc in home folder
create account on pypi.org

fill in pypirc file :

Code:
[distutils]
index-servers =
  pypi
  pypitest

[pypi]
repository: https://upload.pypi.org/legacy/
username: username
password: userpass

[pypitest]
repository: https://testpypi.python.org/pypi
username: username
password: userpass

slide to folder with this structure :
dir1
├── LICENSE.txt
├── README.rst
├── setup.py
├── src
│ ├── example_publish_pypi_medium
│ │ ├── __init__.py
│ │ └── example
│ │ ├── __init__.py
│ │ └── custom_sklearn.py
├── tests
│ ├── __init__.py
│ └── example
│ ├── __init__.py
│ └── test_custom_sklearn.py

^ you can skip the test dir

setup.py :
from distutils.core import setup

Code:
setup(
    name = 'livingrimoire',
    packages = ['livingrimoire1'],
    version = '1',  # Ideally should be same as your GitHub release tag varsion
    description = 'AGI software design pattern',
    author = 'fuki barski',
    author_email = '',
    url = 'https://github.com/yotamarker/LivinGrimoireCorePython',
    download_url = 'https://github.com/yotamarker/LivinGrimoireCorePython/archive/refs/tags/0.1.10.tar.gz',
    keywords = ['tag1', 'tag2'],
    classifiers = [],
)

in cmd (command prompt) surf to project dir1
run these commands :
python setup.py sdist
pip install twine
twine upload dist/*

you should get a link to download the py files project
 
Top