Skip to main content

PyPi template repository.

Project description

PyPi Template

My take at a template repository that I can fork for every Python project I want to push to PyPi

Latest Version on PyPI Build Status Coverage Status Built with PyPi Template Documentation Status

Howto, the executive summary

  1. fork it
  2. rename it
  3. edit it
  4. extend it
  5. use it

Getting Started

Forking and renaming are the two first steps when using this repository. They are both actions you perform at GitHub, but...

Fork without forking...

You don't have to go through the GitHub concept of forking and do everything from the command line...

$ git clone https://github.com/christophevg/pypi-template
$ mv pypi-template your-new-project
$ cd your-new-project
$ git remote remove origin
$ git remote add origin git@github.com:your-account/your-new-project.git
$ git push -u master origin

Use the Command Line

The repository also includes a small script that automates these steps. If you install the module, the script gets registered in your PATH, and allows for

$ pip install pypi-template

$ pypi-template create my-new-project git@github.com:my-account
Cloning into 'pypi-template'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 53 (delta 16), reused 50 (delta 13), pack-reused 0
Unpacking objects: 100% (53/53), done.

$ cd my-new-project/

$ ls
LICENSE.txt		pypi-template		tests
MANIFEST.in		requirements.txt	tox.ini
Makefile		setup.py

$ git remote -v
origin	git@github.com:my-account/my-new-project.git (fetch)
origin	git@github.com:my-account/my-new-project.git (push)

How to upgrade to the lastest version of PyPi Template?

Currently PyPi Template is still very much a moving target. New commits to this project are not guaranteed to turn into conflicts. We'll consider PyPi Template a v1.0.0 project once we've found ways to clearly separate PyPi Template from your project. Until then, you'll have to hack it a bit by merging the changes and going through the conflicts manually.

The procedure will be:

$ git remote add template git@github.com:christophevg/pypi-template
$ git fetch template
$ git merge template

Or use the pypi-template script:

$ pypi-template upgrade

The latter can also be used to "upgrade" and existing project, but this will also often introduce a lot of manual conflict resolution work ;-)

Things to edit

  1. module top-level folder

There is a placeholder top-level module folder. You'll probably want to rename that.

$ mv pypi_template your_new_project
  1. LICENSE.txt

Change the license to whatever you feel is (more) appropriate.

  1. .github/README.md

Replace this information with information regarding your project.

  1. setup.py

Replace the Python package configuration with one appropriate to your project.

Things to do

Testing

A basic testing setup has been prepared. To run it locally, issue...

$ make test
...
___________________________________ summary ____________________________________
  py27: commands succeeded
  congratulations :)

Head over to https://travis-ci.org and register your project. A basic CI configuration is also provided.

Head over to https://coveralls.io and register your project to consult your code coverage reporting.

Publishing

Head over to https://test.pypi.org and register for an account. Next simply issue...

$ make publish-test

to publish your module to the test instance of PyPi.

or

$ make publish

to publish your module to the main instance of PyPi.

If you want to publish your documentation (from the docs/ folder) to e.g. ReadTheDocs, import the repository over there also.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypi-template-0.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypi_template-0.0.3-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

Details for the file pypi-template-0.0.3.tar.gz.

File metadata

  • Download URL: pypi-template-0.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13

File hashes

Hashes for pypi-template-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d5c0563931a30db5773da98123075957b8b3ecb8ccc258b9b5196fd47e7d632b
MD5 a804d9de9d4a7265ae0d814ab5351654
BLAKE2b-256 b8b0e06831b11514b9c465e238586db3ab744182d299097f9ac0ac10d68e86c2

See more details on using hashes here.

File details

Details for the file pypi_template-0.0.3-py2-none-any.whl.

File metadata

  • Download URL: pypi_template-0.0.3-py2-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13

File hashes

Hashes for pypi_template-0.0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 a1570ba0c25c5216851edbc558b386d3e42abbf893f89d7c68312d6bbebfd16a
MD5 e871ac5de55e1aae5dd5d39315805c97
BLAKE2b-256 f0a82b05db20d9e297409e833f08e1baed07b4d34c11064a48debee6a2506cb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page