Skip to main content

ADD SHORT DESCRIPTION HERE

Project description

Template Github Repository

Build docscodecov

This is a template repository for python projects which use sphinx for documentation, github actions for building, pytest and codecov for test coverage.

Getting Started

  1. Choose a name for the new repository. Make sure it's available as a name on testPyPi and PyPi. Create a new directory with that chosen module name.

  2. Create a new repository on github by clicking "Use this template"

  3. Clone this repository into your new directory

    git clone https://github.com/edmundsj/template.git <MODULE_NAME>

  4. Set github pages to use the docs/ folder for github pages at the bottom of the "Settings" page

  5. Add this repositry to codecov: https://app.codecov.io/gh/edmundsj, and add the CODECOV_TOKEN secret to the github repository. You may need to login to codecov to refresh the repositories.

  6. Create a new authentication token on testPyPi and add it as a github secret named test_pypi_token*

  7. Create a new authentication token on PyPi and add it as a github secret named pypi_token*

  8. Navigate into the cloned repository, and run the setup script. This will change all the names in the relevant setup files. If this does not work, see the end of the tutorial.:

    python repo_setup.py

  9. If desired, once the build on the remote server finishes, replace the tokens from testPyPi and pyPi with ones that are restricted to this pyPi project. Delete the old ones.

  10. Create a status badge from the '... -> Create Status Badge' in the github actions area separately for docs and build, and paste them in the README, as well as from codecov. Add a project description in "SETUP.py" and fill out the sections of the downloaded README.

Done! Your repository should be viewable on github pages: https://edmundsj.github.io/REPO_NAME/

  • Note - since the package does not already exist on pyPi or testPyPi you will need to create a token that has access to all your projects. This obviously isn't an optimal way of doing things, and this should really be changed. I may want to add a setup script which does all the renaming, changes github hooks, and does an initial deploy to pypi and testpypi. If you want after the first push, you can create a new token restricted to the newly-pushed project.

If step 6 does not work, you may need to do a git pull before execution. If that doesn't work, you can execute the following manually:

6a. Change the git hooks location:

```git config core.hooksPath .hooks```

6b. Change this repository's name with

git remote set-url origin <NEW_REPO_URL> 6c. In the setup.py, .hooks/pre-commit, and .github/workflows/python-package-conda files, change all instances of "pytemplate" to "MODULE_NAME".

6d. Push to the new repository

```git push -u origin main```

Features

  • Github actions unit test integration via pytest
  • Github actions package management with conda
  • Github actions documentation build using sphinx and reST/markdown, with auto self-push to repository after successful build
  • Github pages documentation hosting/integration
  • Local commits hooks run full test suite
  • Coverage uploaded automatically to codecov after successful build
  • [FUTURE] Auto-deploy to pyPi/testpyPi after successful build

Common Issues

  • Re-running builds on github actions will cause them to fail, as the build number deployed to PyPi depends on the github run number, which does not change if you restart a build.
  • Pypi deploy is a little slower than test pypi, so it may not always be downloading the latest version.

How to Use

Adding Additional Unit Tests

  • Any time you want to add additional unit tests just add them to those in the tests/ directory and prepend with the name test. These will be automatically found by pytest and run during local commits and remote builds.

Writing the Documentation

  • The documentation source is located in docs/source and is written in restructured text (markdown is also available).

Building the Documentation

Simply run make html from the docs/ directory. This will compile the files in the docs/source/ directory, and place them in the main docs/ directory where github pages can find them.

Dependencies / Technologies Used

Acknowledgements

Thanks to all the great people on stack overflow and github, for their seemingly boundless tolerance to my and others' questions.

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

tabularasa-0.1.93.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

tabularasa-0.1.93-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file tabularasa-0.1.93.tar.gz.

File metadata

  • Download URL: tabularasa-0.1.93.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tabularasa-0.1.93.tar.gz
Algorithm Hash digest
SHA256 8c2ce3f37f8871722b218b9e5e9b99022874e8712d6a84eb135364ac6a049488
MD5 e9367e2eaa2dce3e498910cfa2a9a342
BLAKE2b-256 a2e6bf3a00ee7fd3659dd97553a738dbfba238d238f107bfd1db1da0f42c27ee

See more details on using hashes here.

File details

Details for the file tabularasa-0.1.93-py3-none-any.whl.

File metadata

  • Download URL: tabularasa-0.1.93-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tabularasa-0.1.93-py3-none-any.whl
Algorithm Hash digest
SHA256 08a37fc51972467a5071eaeb711bce16106e3f6c60506e91061e0887833e8192
MD5 fbabe4c5f45412ebd21e384556fa8fc3
BLAKE2b-256 22cd72d50599e33b6332668d4585df5e9e2e853d9265f4b7559d978164eb998a

See more details on using hashes here.

Supported by

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