Giter VIP home page Giter VIP logo

cookiecutter-pypackage's Introduction

Cookiecutter PyPackage

Linux build status on Travis CI Windows build status on Appveyor

Cookiecutter template for a Python package, forked from audreyr/cookiecutter-pypackage.

Features

This template has all of the features of the original audreyr/cookiecutter-pypackage, plus the following:

  • Dependency tracking using poetry
  • Linting provided by both pylint and flake8 [executed by Tox]
  • Formatting provided by yapf and isort [checked by Tox]
  • Autodoc your code from Google docstring style (optional)
  • All development tasks (lint, format, test, etc) wrapped up in a python CLI by invoke

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/briggySmalls/cookiecutter-pypackage.git

Then:

  • Create a repo and put it there.
  • Add the repo to your Travis-CI account.
  • Install the dev requirements into a virtualenv. (poetry install)
  • Run the Travis CLI command travis encrypt --add deploy.password to encrypt your PyPI password in Travis config and activate automated deployment on PyPI when you push a new tag to master branch.
  • 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.
  • Get your code on! ๐Ÿ˜Ž Add your package dependencies as you go, locking them into your virtual environment with poetry add.
  • Activate your project on pyup.io.

For more details, see the cookiecutter-pypackage tutorial.

cookiecutter-pypackage's People

Contributors

audreyfeldroy avatar benjaoming avatar briggysmalls avatar cerickson avatar eliasdorneles avatar erwinjanssen avatar gregmuellegger avatar jestaubach avatar jhonjairoroa87 avatar katialira avatar kevgathuku avatar kiivihal avatar kragniz avatar krallin avatar mandeep avatar manuphatak avatar palmerev avatar purplediane avatar pydanny avatar pyup-bot avatar requires avatar rgbkrk avatar rwanyoike avatar skarbot avatar thejonanshow avatar tony avatar treyhunner avatar vijayantajain avatar westurner avatar yukihiko-shinoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cookiecutter-pypackage's Issues

template inconsistencies (author)

  • Date you used Cookiecutter PyPackage: 2020-01-04
  • Cookiecutter version used, if any: 1.7.0
  • Python version, if any: 3.7
  • Operating System: Ubuntu 18.04

Description

This is minor, and maybe intentional, but in your README.rst it credits the original author instead of your fork. Perhaps both should be mentioned? I may also comment on this issue as time goes on if I find any other inconsistencies that you might have overlooked.

Let me know if this is not helpful. My intent is to be helpful and give credit where credit is due. Like what I see so far.

What I Did

Ran cookiecutter

tox fails, can't find setup.py

  • Date you used Cookiecutter PyPackage: 2020-05-28
  • Cookiecutter version used, if any: 1.6.0
  • Python version, if any: 3.7
  • tox version: 3.14.0
  • Operating System: RHEL7

Description

I created a new project with this cookiecutter template, and ran tox immediately afterward on the generated project. This failed with

$ tox
ERROR: No setup.py file found. The expected location is:
  <redacted>/setup.py
You can
  1. Create one:
     https://packaging.python.org/tutorials/distributing-packages/#setup-py
  2. Configure tox to avoid running sdist:
     https://tox.readthedocs.io/en/latest/example/general.html#avoiding-expensive-sdist

Update tests to fomat/lint for different commands

#16 introduces that tests run the formatter and linter which is great. However this is only done for the project defaults.

These tests should be updated to configure using click/argparse, pytest/unittest, etc, to ensure that different project outputs conform to e.g. the formater immediately

Rename project

It might be worth renaming this project to differentiate it from the original?

It isn't necessary but could be good for visibility.

Generated package cannot build docs

  • Date you used Cookiecutter PyPackage: 2020/03/17
  • Cookiecutter version used, if any: 1.6.0
  • Python version, if any: 3.7
  • Operating System: macOS

Description

Building the docs for a generated project fails because conf.py tries to use the sphinxcontrib.napoleon package.

However since Sphinx 1.3 this has been shipped with sphinx, and named sphinx.ext.napoleon.

This should be updated

What I Did

invoke docs

Build fails because of invocations

  • Date you used Cookiecutter PyPackage: 2020/03/17
  • Cookiecutter version used, if any: N/A
  • Python version, if any:
  • Operating System: linux

Description

The CI server fails (as does my local machine) because the invocations package (used to document invoke) uses a deprecated sphinx API.

The issue has been reported pyinvoke/invocations#19

What I Did

Ran documentation build

invoke docs

Pubilcise project

Once #2 is resolved the project should be publicised on the original cookiecutter-pypackage page,

Move package management to Poetry

As little as I like running after the new hotness, I suspect that Poetry is replacing pipenv as the defacto package manager for python.
It recently released a stable 1.0 version, and seems to be well liked by the hackernews hivemind.
Something to consider maybe

Add documentation for invoke

I really like using invoke for linting/formatting/testing etc. but people may not realise how to use it.

This should be added to the project documentation

Bad indentation

  • Date you used Cookiecutter PyPackage: 2020/03/17
  • Cookiecutter version used, if any: 1.6.0
  • Python version, if any: 3.7
  • Operating System: macOS

Description

When a new project is generated, the extensions variable in conf.py has bad indentation if Google style comments are used:

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.viewcode',
'sphinxcontrib.napoleon',

]

What I Did

Simply generated a project, with google docstrings on.

Remove mentions of setup.py

If I run a search for setup.py on the repo I get quite a few hits:

Searching 61 files for "setup.py" (case sensitive)

...

13 matches across 8 files

All of these are cosmetic (tests, comments, or documentation) but it is pretty confusing.

Restrict python version

poetry add can fail because python version not restricted tightly enough.

python = "*" is not useful. Better to do something like python = "^3.5"?

bitbucket support

  • Date you used Cookiecutter PyPackage: 2020-01-04
  • Cookiecutter version used, if any: 1.7.0
  • Python version, if any: 3.7
  • Operating System: Ubuntu 18.04

Description

Ran cookiecutter and it asks for github_username. I do have a github, but I use bitbucket a lot more. Does this have support for bitbucket? How hard would it be to add support?

What I Did

cookiecutter gh:briggySmalls/cookiecutter-pypackage

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.