| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Python project using simple setuptools project config; note package data, scripts, entry points, etc, all still work using pyproject.toml per setuptools documentation.
To create a new repository using this template, click the button labeled Use this template and select Create a new repository.
After creating your repository, replace the example project name "simple" with your own:
Create an orphan branch for Pylint and Coverage workflows. In a fresh checkout, run the following commands:
$ git checkout --orphan badges $ git reset --hard $ git commit --allow-empty -m "Initializing badges branch" $ git push origin badges $ git checkout main
Follow the same steps shown above, changing the branch name to gh-pages.
This project uses setuptools_scm for dynamic versioning, therefor some of the (github) workflows will look for a git tag to set the version in CI. If there are no tags, this will result in some failed workflow runs. There are several options to make them succeed:
Some of the automation workflows may also fail without some non-default repository settings; the following changes are required to allow these workflows to run.
Go to the repository Settings tab and scroll to the bottom of the General settings and enable these checkboxes under Pull Requests:
Next, in the left-hand menu under the Settings tab, click Actions, then General, then scroll to Workflow permissions:
In addition, the provided dependabot config expects some issue labels, so open the project URL below (using your new project name) and add the following new labels:
https://github.com/<your_name>/<project_name>/issues/labels
Finally, best practices for public repositories should include the following extra features:
Local tool dependencies to aid in development; install them for maximum enjoyment.
Initial configurations and first-item doc stubs have been created in the following directories:
$ tree reqs/ docs/swd/ tests/docs/ reqs/ ├── .doorstop.yml └── REQ001.yml docs/swd/ ├── assets │ ├── .gitkeep │ └── simple_dependency_graph.svg ├── .doorstop.yml └── SDD001.md tests/docs/ ├── .doorstop.yml └── TST001.yml
The doorstop tool has been added to project [dev] "extras" as well as the tox dev and docs environments. Use the "dev" environment for working with doorstop documents, eg:
tox -e dev source .venv/bin/activate (.venv) doorstop building tree... loading documents... validating items... WARNING: SDD: SDD001: unreviewed changes REQ │ ├── TST │ └── SDD
Please see the doorstop Quick Start for an overview of the relevant doorstop commands. See the rpmget project for a more fleshed out real-world example of using doorstop and sphinx together.
As long as you have git and at least Python 3.8, then you can install and use tox. After cloning the repository, you can run the repo checks with the tox command. It will build a virtual python environment for each installed version of python with all the python dependencies and run the specified commands, eg:
$ git clone https://github.com/sarnold/simple-python-project $ cd simple-python-project/ $ tox -e py
The above will run the default test command using the (local) default Python version. To specify the Python version and host OS type, run something like:
$ tox -e py311-linux
To build and check the Python package, run:
$ tox -e build,check
Full list of additional tox commands:
To build/lint the api docs, use the following tox commands:
We use gitchangelog to generate a changelog and/or release notes, as well as the gitchangelog message format to help it categorize/filter commits for tidier output. Please use the appropriate ACTION modifiers for important changes in Pull Requests.
This repo is also pre-commit enabled for various linting and format checks. The checks run automatically on commit and will fail the commit (if not clean) with some checks performing simple file corrections.
If other checks fail on commit, the failure display should explain the error types and line numbers. Note you must fix any fatal errors for the commit to succeed; some errors should be fixed automatically (use git status and git diff to review any changes).
See the following sections in the built docs for more information on gitchangelog and pre-commit.
You will need to install pre-commit before contributing any changes; installing it using your system's package manager is recommended, otherwise install with pip into your usual virtual environment using something like:
$ sudo emerge pre-commit --or-- $ pip install pre-commit
then install it into the repo you just cloned:
$ git clone git@github.com:sarnold/simple-python-project.git $ cd simple-python-project/ $ pre-commit install
It's usually a good idea to update the hooks to the latest version:
pre-commit autoupdate
This project is now compliant with the REUSE Specification Version 3.3, so the corresponding license information for all files can be found in the REUSE.toml configuration file with license text(s) in the LICENSES/ folder.
Related metadata can be (re)generated with the following tools and command examples.
Use tox to create the environment and run the lint command:
$ tox -e reuse # --or-- $ tox -e reuse -- spdx > sbom.txt # generate sdist files sbom
Note you can pass any of the other reuse commands after the -- above.
Use the above environment to generate the full SBOM in text format:
$ source .tox/reuse/bin/activate $ sbom4python --system --use-pip -o <file_name>.txt
Be patient; the last command above may take several minutes. See the doc links above for more detailed information on the tools and specifications.
| Back | FazBrowse Home | New Git URL |