Giter VIP home page Giter VIP logo

cookiecutter-python-library's Introduction

Cookiecutter PyPackage

Build Status Documentation Status

Cookiecutter template for a Python package.

Features

  • Testing setup with unittest and python setup.py test or pytest
  • Travis-CI: Ready for Travis Continuous Integration testing
  • Tox testing: Setup to easily test for Python 3.7, 3.8, and 3.9, with optional support for Python 3.6
  • Sphinx docs: Documentation ready for generation with, for example, Read the Docs
  • bump2version: Pre-configured version bumping with a single command
  • Auto-release to PyPI when you push a new tag to master (optional)
  • Command line interface using Click or argparse (optional)

Quickstart

Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):

pip install -U cookiecutter

Generate a Python package project:

cookiecutter https://github.com/pymetrics/cookiecutter-python-library.git

Then:

  • Create a repo and put it there.
  • Add the repo to your Travis-CI account.
  • Install the dev requirements into a virtualenv. (pip install -r requirements_dev.txt)
  • Register your project with PyPI. * Run twine upload dist/*.
  • For an open source project, create a PyPI API token, with scope limited to the project, for publishing.
  • Set PyPI credentials in TravisCI environment variables PYPI_USERNAME and PYPI_PASSWORD. * If using an API token, set PYPI_USERNAME to __token__.
  • Add the repo to your Read the Docs account + turn on the Read the Docs service hook.
  • Release your package by pushing a new tag to master.
  • Add a requirements.txt file that specifies the packages you will need for your project and their versions. For more info see the pip docs for requirements files.

For more details, see the cookiecutter-pypackage tutorial.

Credits

Forked from @audryr's cookiecutter-pypackage.

cookiecutter-python-library's People

Contributors

andremiras avatar audreyfeldroy avatar benjaoming avatar breezko avatar cerickson avatar chadbailey avatar chrislawlor avatar cxong avatar eliasdorneles avatar erwinjanssen avatar gregmuellegger avatar hugovk avatar jestaubach avatar jhonjairoroa87 avatar katialira avatar kevgathuku avatar mandeep avatar manuphatak avatar palmerev avatar psiace avatar purplediane avatar pydanny avatar pyup-bot avatar rgbkrk avatar rwanyoike avatar skarbot avatar thejonanshow avatar tony avatar treyhunner avatar westurner avatar

Watchers

 avatar  avatar

cookiecutter-python-library's Issues

Fix default PyPI URL

  • Date you used Cookiecutter PyPackage: 11-28-2021
  • Cookiecutter version used, if any:
  • Python version, if any:
  • Operating System:

Description

Twine upload fails:

$ twine upload --skip-existing -r pypi dist/*

UploadToDeprecatedPyPIDetected: You're trying to upload to the legacy PyPI site 'https://pypi.python.org/simple'. Uploading to those sites is deprecated. 

 The new sites are pypi.org and test.pypi.org. Try using https://upload.pypi.org/legacy/ (or https://test.pypi.org/legacy/) to upload your packages instead. These are the default URLs for Twine now. 

 More at https://packaging.python.org/guides/migrating-to-pypi-org/ .

Need to change default option for PyPI URL to https://upload.pypi.org/legacy/

Python 3.6 builds fail

Need to spec cryptography<3.4, newer source requires a Rust compiler which is not available on Travis.

Adding this stanza to tox.ini fixes the issue for a generated project:

[testenv:py36]
deps =
    cryptography<3.4
    -r{toxinidir}/requirements_dev.txt

Setup.py should read from requirements.txt

  • Create a requirements.txt file by default. It
  • If using click, add to requirements.txt instead of adding directly to setup.py
  • Modify setup.py to read requirements from requirements.txt.

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.