Packaging and Publishing

Total Post:113

Points:791
Python 
 386  View(s)
Ratings:
Rate this:

How to implement Packaging and Publishing in Python ?

  1. Post:140

    Points:984
    Re: Packaging and Publishing

    Packaging and Publishing Python code :

    pip install package_name  

    Get the python scripts ready : 

    locator.py 

    Getting the package-directory structure ready : 

    setup.py 
    pip install setuptools 
    from setuptools import setup 
      # reading long description from file 
    with open('DESCRIPTION.txt') as file:
        long_description = file.read()
    # specify requirements of your package here
    REQUIREMENTS = ['requests']
    # some more details
    CLASSIFIERS = [
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Topic :: Internet',
        'License :: OSI Approved :: MIT License'
        'Programming Language :: Python :: 3.5',
        ]
    # calling the setup function
    setup(name='mygmap',
          version='1.0.0',
          description='A small wrapper around google maps api',
          long_description=long_description,
          url='https://github.com/prakashnidhiverma/mygmap',
          author='Nikhil Kumar Singh',
          author_email='pnv@mindstick.com.com',
          license='MIT',
          packages=['geo'],
          classifiers=CLASSIFIERS,
          install_requires=REQUIREMENTS,
          keywords='maps location address'
          )

    different arguments of setup function do:

    -name 

    -version

    -description

    -long_description

    -url

    -author, author_email

    -license

    -classifiers

    -install_requires

    -keywords

    __init__.py
    

    Upload the package: 

    python setup.py register -r pypitest 
    python setup.py sdist upload -r pypitest 
    python setup.py register -r pypi 
    python setup.py sdist upload -r pypi 
    pip install your_package_name 

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.