Skip to content

ActivandoIdeas/Python-Package-Cookiecutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cookiecutter-django-rest

Python Packager

This is a cookiecutter template for generate a package

license badge python badge

About this cookiecutter

Features

  • Simple and basic configuration for make a package and publish in pypi

Prerequisites

Install cookiecutter

pip install --user cookiecutter

Install

Use this command

cookiecutter https://github.com/ActivandoIdeas/Python-Package-Cookiecutter

setup.py

  • Use setuptools It's the standard packaging library for Python. distribute has merged back into setuptools, and distutils is less capable.
  • setup.py should not import anything from the package When installing from source, the user may not have the packages dependencies installed, and importing the package is likely to raise an ImportError.
  • setup.py should be the canonical source of package dependencies There is no reason to duplicate dependency specifiers (i.e. also using a requirements.txt file). See the testing section below for testing dependencies.

Testing

  • Use Tox to manage test environments Tox provides isolation, runs tests across multiple Python versions, and ensures the package can be installed.
  • Uses pytest as the default test runner This can be changed easily, though pytest is a easier, more powerful test library and runner than the standard library's unittest.
  • Define testing dependencies in tox.ini Avoid duplicating dependency definitions, and use tox.ini as the canonical description of how the unittests should be run.
  • tests directory should not be a package The tests directory should not be a Python package unless you want to define some fixtures. But the best practices are to use PyTest fixtures which provides a better solution. Therefore, the tests directory has no __init__.py file.

Build the solution

python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel
python -m pip install --user --upgrade twine
python -m twine upload dist/*

License

BSD 3-Clause "New" or "Revised" License View in https://github.com/ActivandoIdeas/Cookiecutter-Django-AppEngine-GitLab/blob/master/LICENSE

Contributing

Contributors are always welcome! Feel free to raise an issue or submit a PR. Read the code of Conduct here: https://github.com/ActivandoIdeas/Codigo-de-Conducta-y-Guia-Rapida

This project is based on cuokiecutter:

Releases

No releases published

Packages

No packages published

Languages