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 - biosustain/python_package: Example Python package

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

44 Commits
44 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
src/python_package
src/python_package
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
CITATION.cff
CITATION.cff
 
 
Contributing.md
Contributing.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
developing.md
developing.md
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

Example Python package

All design principles are explained in the developing.md file. The Python package template was created by Jakob Nybo Nissen and Henry Webel.

How to use

Can be used as GitHub template repository, see GitHub documentation.

You will need to find and replace occurences of

  • python_package -> your_package_name

    • also the folder src/python_package
  • RasmussenLab -> GitHub_user_name (or organization) with the name of your package and GitHub user name (or organization).

  • look for First Last to see where to replace with your name

  • choose a license, see GitHub documentation and Creative Commons. Replace LICENSE file with the license you choose.

  • Update the CITATION.cff file with your information.

  • once you change the code under src, please make sure to update

    • docs/tutorial/tutorial.ipynb (add your usage example)
    • tests/test_mockup.py (delete file and add your own tests following the naming conventions test_<filename>.py)

Development environment

Install package so that new code is picked up in a restared python interpreter:

pip install -e ".[dev]"

Then you want to run locally the commands which are check in the CI/CD pipeline (using GitHub Actions). You can type

# run unittests
pytest tests
# format code and sort imports
black .
isort .
# lint code and check for obvious errors
ruff check src

Basic usage

works using this template

from python_package import hello_world
print (python_package.__version__)
print(hello_world(4))

Readthedocs

The documentation can be build using readthedocs automatically. See project on Readthedocs for the project based on this template. A new project needs to be registered on ReadTheDocs.

  • make sure to enable build from PRs in the settings (advanded settings)
  • checkout configuration file: .readthedocs.yaml

About

Example Python package

python-package-template-biosustain.readthedocs.io/

Resources

Readme
GPL-3.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — 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.