Is production: true
#migrated

Title: How to release python package to pypi

Created: 19 Mar 2023 Modified: 19 Mar 2023

Description:



[Legacy Link]

Instructions

  1. Create project under directory

    mkdir my-project
    cd my-project
    
  2. create virtual environment

  3. create structure

    # create directory for source code
    mkdir src
    touch setup.py
    touch README.md
    touch LICENSE.txt
    touch src/helloworld.py
    
  4. install dependencies

    pip install wheel
    
  5. fill in code helloworld.py

    def hello_world():
      print('hello world')
    
  6. fill in README.txt

    # Chia Log Processor
    
    A library provide functionality process chia plot log.
    
    # Installation
    

    pip install {project name}

    
    # Demo
    
    ```python
    import {module} 
    
  7. fill in license.txt

  8. fill in information of setup.py

    from setuptools import setup
    
    with open("README.md", "r") as fh:
        long_description = fh.read()
    
    projectName = "projectName"
    projectDescritpion = "Description"
    version = "0.0.1"
    modules = ['hello']
    url = "{git repo url}"
    author = "author"
    email = "[email protected]"
    
    setup(
        name=projectName,
        version=version,
        description=projectDescritpion,
        py_modules=modules,
        package_dir={'': 'src'},
        long_description=long_description,
        long_description_content_type="text/markdown",
        url=url,
        author=author,
        author_email=email,
        extras_require={
            "dev": [
                "pytest>=3.7",
            ]
        }
    )