GithubHelp home page GithubHelp logo

python-package-template's Introduction

python-package-template

Documentation

Example Project Structure for a Python / PyPI Project

Installation

Note that this supports Python 3 ONLY

Basic Usage

Warning eggs are deprecated in favor of wheels, and not supported by pip.

This project is a sample template used to aggregate the process of

  • Laying out a python project
  • Using setuptools build system to
    • to facilitate packaging Python projects
    • Python package and module definitions
    • Distribution package metadata
    • Project installation

Outline the process to

  • Create Python Eggs - a single-file importable distribution format
  • Automatically include all packages in your source tree, without listing them individually in setup.py
  • Automatically generate wrapper scripts or Windows (console and GUI) .exe files for any number of “main” functions in your project. (Note: this is not a py2exe replacement; the .exe files rely on the local Python installation.)

Command Reference

[https://setuptools.readthedocs.io/en/latest/setuptools.html#command-reference]

For example, to produce a source distribution, simply invoke:

python setup.py sdist

Detailed instructions to distribute a setuptools project can be found at Packaging project tutorials. [https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives]

Before you begin, make sure you have the latest versions of setuptools and wheel:

python -m pip install --user --upgrade setuptools wheel

To build a setuptools project, run this command from the same directory where setup.py is located:

python setup.py sdist bdist_wheel

This will generate distribution archives in the dist directory.

Uploading to test.pypi.org:

Before you upload the generated archives make sure you’re registered on [https://test.pypi.org/account/register/]. You will also need to verify your email to be able to upload any packages. You should install twine to be able to upload packages:

python -m pip install --user --upgrade twine

Now, to upload these archives, run:

python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

To install your newly uploaded package example_pkg, you can use pip:

python -m pip install --index-url https://test.pypi.org/simple/ example_pkg

If you have issues at any point, please refer to Packaging project tutorials for clarification.

Credits

Patrick Shiel: github.com/patrickshiel

License

MIT License

python-package-template's People

Contributors

patrickshiel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.