Giter Site home page Giter Site logo

pawamoy / cookiecutter-pydjama Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ionelmc/cookiecutter-pylibrary

2.0 2.0 0.0 819 KB

Cookiecutter template for Python package or Django apps

Python 77.33% Shell 14.59% PowerShell 3.42% CSS 4.66%
cookiecutter python django cookiecutter-template

cookiecutter-pydjama's Introduction

cookiecutter-pydjama

This cookiecutter is originally a fork of cookiecutter-pylibrary, but it also combines features from cookiecutter-pypackage and cookiecutter-djangopackage.

It fits really well my needs, but maybe not yours, so don't hesitate to fork it.

Features

  • Support for Django, tests with django-fake-model.
  • ISC License.
  • Tox for managing test environments for Python 2.7, 3.6, PyPy etc.
  • Pytest for testing Python 2.7, 3.6, PyPy etc.
  • Travis-CI for continuous testing.
  • Coveralls or Codecov for coverage tracking (using Tox).
  • Documentation with Sphinx, ready for ReadTheDocs.
  • Configurations for isort, bumpversion, yapf and prospector.
  • Packaging and code quality checks. This template comes with a tox environment (check) that will:
    • Check if your setup.py is valid.
    • Check if your README.rst is valid.
    • Check if the MANIFEST.in has any issues.
    • Run bandit (a security issue checker for python code).
    • Run safety (a PyUp tool to check your dependencies).
    • Run prospector (Landscape 's tool for static code analysis).
  • Badges for everything in README.rst, including PyUp, Landscape and Gitter.
  • Script to easily release code to PyPiTest and PyPi.
  • Script to easily update your generated project when the cookiecutter changes. To enable this, you wil need to create a cookiecutter branch in the repository.

Requirements

Projects using this template have these minimal dependencies:

  • Cookiecutter for creating the project
  • Tox for running the tests
  • Setuptools for building the package, wheels etc.
  • Twine to register and upload the code to PyPiTest and PyPi.
pip install tox cookiecutter twine

Usage and options

First generate your project:

cookiecutter gh:Pawamoy/cookiecutter-pydjama

After this you can create the initial repository (make sure you create an empty Github project):

git init .
git add .
git commit -m "Initial skel."
git remote add origin [email protected]:username/reponame.git
git push -u origin master
git checkout -b cookiecutter
git push --set-upstream origin cookiecutter

Then:

  • Enable the repository in your Travis, Codecov, Coveralls, Landscape, Gitter, ReadTheDocs accounts
  • For ReadTheDocs: turn on the ReadTheDocs service hook. Don't forget to enable virtualenv and specify docs/requirements.txt as the requirements file in Advanced Settings.

Developing the project

To run all the tests, just run:

tox

To see all the tox environments:

tox -l

To only build the docs:

tox -e docs

To build and verify that the built package is proper and other code QA checks:

tox -e check

Releasing the project

Before releasing your package on PyPI you should have all the tox environments passing.

Version management

This template provides a basic bumpversion configuration. It's as simple as running:

  • bumpversion patch to increase version from 1.0.0 to 1.0.1.
  • bumpversion minor to increase version from 1.0.0 to 1.1.0.
  • bumpversion major to increase version from 1.0.0 to 2.0.0.

You should read Semantic Versioning 2.0.0 before bumping versions.

Building and uploading

Store your credentials in a .pypirc file in your home.

[distutils]
index-servers =
  pypi
  pypitest

[pypi]
repository=https://pypi.python.org/pypi
username=your_username
password=your_password

[pypitest]
repository=https://testpypi.python.org/pypi
username=your_username
password=your_password

Then just run ./release.sh. It tox -e check succeeds, then the script will successively try to register then upload on PyPiTest first then PyPi server. If any of these steps fails, the script stops.

Changelog

See CHANGELOG.rst.

cookiecutter-pydjama's People

Contributors

abusalimov avatar audreyfeldroy avatar cmeeren avatar csarn avatar dragon788 avatar dupuy avatar esparta avatar ionelmc avatar jeffpaine avatar jpsca avatar kaidokert avatar krallin avatar lgiordani avatar ludovic-gasc avatar luzfcb avatar pawamoy avatar rgbkrk avatar seanfisk avatar solarnz avatar stefankjartansson avatar svetlyak40wt avatar tantale avatar tony avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cookiecutter-pydjama's Issues

Make it opinionated

I don't think so many people use this cookiecutter so I'm gonna make it more opinionated:

  • use of Pipenv
  • use of tox (clean-up needed)
  • maybe a makefile for convenience
  • use of flit, pyproject.toml: better release experience, no more script needed. This will only work if I can find a workaround for tox's mandatory setup.py and flit's mandatory top-level package (not src/package) -> no more setup.cfg and MANIFEST
  • less half-time working tools like prospector/pylama, more robust ones like pylint + plugins
  • remove almost all services (and badges) except some of them like gitter and pyup (don't any CI alternative to pyup)
  • use of docker
  • use of markdown for sphinx instead of rst

If I can find a way to mirror the repositories on gitlab in a clean way, then:

  • use of gitlab ci (no more travis)
  • use of gitlab pages (no more readthedocs)
  • use of gitlab ci coverage ability (no more codacy) + code quality job and badge

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.