Git Product home page Git Product logo

project-template-python-pure's Introduction

python-project-template

A project template for pure python projects.

Project Structure / Packaging

This project uses setuptools for packaging and defines all necessary options in the file pyproject.toml. setup.py andsetup.cfg are not needed.

We use the src/ based layout, as this avoids several issues with editable installs and confusion with what is imported (local directory or installed module). See setuptools/src-layout.

Editable installations

Editable installations in this setup rely on PEP 660 (see above), support was introduced in pip 21.3 (released 2021-10) and setuptools 64.0 (released 2022-08). The setuptools version is required in pyproject.toml.

To install in editable mode, use

$ pip install -e .

you can add extras, e.g. for developing and building the docs, use

$ pip install -e '.[dev,doc,test]'

or just

$ pip install -e '.[all]'

Keep in mind that editable installations have limitations as to what changes can take effect automatically without rerunning pip install -e .. Python code changes to existing files take effect, but for example adding new entry-points, changes to the source code of compiled extensions etc. will require rerunning the installation.

See https://setuptools.pypa.io/en/latest/userguide/development_mode.html#limitations

Versioning

This template uses setuptools_scm to automatically generate the version from the last git tag. For local development, setuptools_scm will build a version development version. For releases, version information is included in the sdist and wheel files and setuptools_scm is not used when installing those. The setup is somewhat complex and was taken by astropy. It ensures that the setuptools scm version is only used in development setups, not in the releases packages.

CI

For github, see .github/workflows/, for gitlab, see .gitlab-ci.yml

Docs

The sphinx setup here is WIP, to be improved.

project-template-python-pure's People

Contributors

maxnoe 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.