GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CunliangGeng/python-template: Python project template

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

236 Commits
236 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
tests
tests
 
 
{{cookiecutter.repo_name}}
{{cookiecutter.repo_name}}
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.zenodo.json
.zenodo.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
appveyor.yml
appveyor.yml
 
 
codemeta.json
codemeta.json
 
 
cookiecutter.json
cookiecutter.json
 
 
pytest.ini
pytest.ini
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Python Template

This template is adapted from the Netherlands eScience Center Python Template.

Due to the big changes, do NOT try to sync it from the original repo.

RSD Appveyor Build Status DOI

Spend less time setting up and configuring your new Python packages and comply with the Netherlands eScience Center Software Development Guide from the start.

Use this Cookiecutter template to generate an empty Python package. Features include:

  • Boilerplate tests and documentation,

  • Python setup configuration,

  • Open source software license,

  • Default Github actions for building, testing and deployment

  • Code style checking,

  • Editorconfig,

  • Miscellaneous files, such as Change log, Code of Conduct, and Contributing guidelines,

  • A README and a separate document with extensive documentation about project setup.

The file structure of the generated package looks like:

path/to/package/
├── .editorconfig
└── .github/
    └── workflows
        ├── build.yml
        └── pypi_deploy.yml
├── .gitignore
├── .prospector.yml
├── CHANGELOG.rst
├── CODE_OF_CONDUCT.rst
├── CONTRIBUTING.rst
├── docs
│   ├── MAKEFILE
│   └── source
│       ├── conf.py
│       ├── index.rst
│       └── ...
├── LICENSE
├── MANIFEST.in
├── NOTICE
├── package
│   ├── __init__.py
│   ├── __version__.py
│   └── package.py
├── README.md
├── project_setup.md
├── requirements.txt
├── setup.cfg
├── setup.py
└── tests
    ├── __init__.py
    ├── test_lint.py
    └── test_package.py
  • Code (existing or new) should be placed in path/to/package/package/ (please choose a better name for your software!).
  • Add documentation by editing path/to/package/docs/index.rst
  • Tests go in the path/to/package/tests/ directory
  • The generated project setup document contains extensive documentation about the project setup and provides further instructions on what to do.

How to use

We recommend developing your software in an isolated Python environment and assume you are familiar with either virtualenv + pip or conda (check the guide if you are not).

Step 1: Install cookiecutter

We recommend installing cookiecutter outside the virtual environment you will be using for developing your software. This way, you don't have to install cookiecutter for every new project.

  • If you are using virtualenv + pip:

     pip install --user cookiecutter
  • If you are using conda:

     conda install -c conda-forge cookiecutter

Step 2: Generate the files and directory structure

To create a new package, type:

cookiecutter https://github.com/CunliangGeng/python-template.git

You will be asked to supply the following information:

Name Default value Explanation
repo_name Repo-and-package-name The git repo name and pypi package name
module_name import_module_name The top module name for import. It is safest not to use dashes (-) or spaces in this name.
project_short_description The information that you enter here will end up in the README, documentation, license, and setup.py, so it may be a good idea to prepare something in advance.
version 0.1.0
github_organization GitHub organization that will contain this project's repository. This can also be your github user name.
open_source_license Apache 2.0 (1) The software license under which the code is made available.
apidoc no (1) Add support for automatically generating a module index from the docstrings in your Python package (look at the scriptcwl package for an example).
pypi_user no_travis_pypi_deployment If you want to deploy your package via travis to pypi when you make a release, specify your pypi user name. If not, use the default value. Please note that if you are using this option, some additional configuration is required. The README of the generated package explains what to do.
full_name John Smith Your full name, e.g. John Smith.
email [email protected] Your (work) email address
copyright_holder Name(s) of the organization(s) or person(s) who hold the copyright of the software (e.g., Netherlands eScience Center).
code_of_conduct_email [email protected] Email address of the person who should be contacted in case of violations of the Code of Conduct.

Step 3: Create and activate a Python environment

  • If you are using virtualenv + pip, do:
     $ virtualenv -p python3 env
     $ . env/bin/activate
  • If you are using conda, type:
     $ conda create -n env python=3
     $ source activate env
    (On windows use activate env to activate the conda environment.)

Continuous integration with Github Actions

The template has two Ci workflows. They can be found in .github/workflows folder.

  1. build.yml

This workflow install the dependencies, builds the package and runs tests.

  1. pypi.yml

This workflow pushes the package to PYPI. This action will require PYPI token to be stored as Github secret. The workflow uses secret with a name of PYPI_TOKEN.

You can learn more about Python packaging at this link.

How to contribute

Suggestions/improvements/edits are most welcome. Please read the contribution guidelines before creating an issue or a pull request.

About

Python project template

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.