Handy utils for Python projects.
Project description
Comb Utils
Summary
Some handy utils for Python projects. Repo is made from the reference_package template repo: https://github.com/crickets-and-comb/reference_package. See the docs: https://crickets-and-comb.github.io/shared_utils/.
Structure
.github/workflows GitHub Actions CI/CD workflows.
docs RST docs and doc build staging.
Makefile Dev tools and params. (includes shared/Makefile)
setup.cfg Metadata and dependencies.
shared Shared dev tools Git submodule.
src/comb_utils/lib Implementation.
tests/e2e End-to-end tests.
test/integration Integration tests.
tests/unit Unit tests.
Installation
To install the package, run:
$ pip install comb_utils
See https://pypi.org/project/comb-utils/.
Dev workflow
There are a number of dev tools in the Makefile. You can list all the make tools you might want to use:
$ make list-targets
Go check them out in Makefile.
Note: The dev tools are built around developing on a Mac, so they may not all work on Windows without some modifications.
Shared tools setup
When you first clone this repo, you'll need to set up the shared tools Git submodule. Follow the setup directions on that repo's README: https://github.com/crickets-and-comb/shared
Updating shared tools
Once you've set up the shared dev tools submodule, you'll want to periodically update it to get updates to the shared tools:
$ make update-shared
Note that, while you'll be able to run with this updated shared submodule, you'll still want to commit that update to your consuming repo to track that update.
Setting Personal Access Token
The shared workflows rely on a Personal Access Token (PAT) (to checkout the submodule so they can use the make targets). You need to create a PAT with repo access and add it to the consuming repo's (comb_utils in this case) action secrets as CHECKOUT_SHARED. See GitHub for how to set up PATs (hint: check the developer settings on your personal account) and how to add secrets to a repo's actions (hint: check the repo's settings).
Note: Using a PAT tied to a single user like this is less than ideal. Figuring out how to get around this is a welcome security upgrade.
Dev installation
You'll want this package's site-package files to be the source files in this repo so you can test your changes without having to reinstall. We've got some tools for that.
First build and activate the env before installing this package:
$ make build-env
$ conda activate comb_utils_py3.12
Note, if you don't have Python installed, you need to pass the package name directly when you build the env: make build-env PACKAGE_NAME=comb_utils. If you have Python installed (e.g., this conda env already activated), then you don't need to because it uses Python to grab the package name from the setup.cfg file.
Then, install this package and its dev dependencies:
$ make install
This installs all the dependencies in your conda env site-packages, but the files for this package's installation are now your source files in this repo.
QC and testing
Before pushing commits, you'll usually want to rebuild the env and run all the QC and testing:
$ make clean format full
When making smaller commits, you might just want to run some of the smaller commands:
$ make clean format full-qc full-test
As a final step, it's good practice to test run the workflow before opening a PR or pushing to an open PR. We don't want to waste GitHub runtime on a glitch that we could have caught before. You can use a make target for that:
$ make run-act
That will run .github/workflows/CI_CD.yml. But, you can also run any workflow you'd like by using act directly. See https://nektosact.com.
To use this tool, you'll need to have Docker installed and running on your machine: https://www.docker.com/. You'll also need to install act in your terminal:
$ brew install act
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file comb_utils-0.1.1.tar.gz.
File metadata
- Download URL: comb_utils-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b294b829bef1aab94ba56ad2d7ba83189770814644f3ac611d535d9e6c03c0b7
|
|
| MD5 |
a40c332015025610e2e63ff7a43028d3
|
|
| BLAKE2b-256 |
e3398d740de4be4db8705c9fe0d811cbc90d727a7ce457118e49954f3a37d54a
|
Provenance
The following attestation bundles were made for comb_utils-0.1.1.tar.gz:
Publisher:
CI_CD.yml on crickets-and-comb/comb_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comb_utils-0.1.1.tar.gz -
Subject digest:
b294b829bef1aab94ba56ad2d7ba83189770814644f3ac611d535d9e6c03c0b7 - Sigstore transparency entry: 167008372
- Sigstore integration time:
-
Permalink:
crickets-and-comb/comb_utils@95c1a4a97d87a99afe5f402488f2496d9deae134 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/crickets-and-comb
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI_CD.yml@95c1a4a97d87a99afe5f402488f2496d9deae134 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file comb_utils-0.1.1-py3-none-any.whl.
File metadata
- Download URL: comb_utils-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc51835435f897fdd9d45e453183550686f49db354b7a7d08c744e3096f94da
|
|
| MD5 |
dca767eb6967ba44193a74f09d53c0cd
|
|
| BLAKE2b-256 |
ee365762da86d61601a4ef5751dc2d135dc74bf3145aa9678327bbbe13b64ba9
|
Provenance
The following attestation bundles were made for comb_utils-0.1.1-py3-none-any.whl:
Publisher:
CI_CD.yml on crickets-and-comb/comb_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comb_utils-0.1.1-py3-none-any.whl -
Subject digest:
cfc51835435f897fdd9d45e453183550686f49db354b7a7d08c744e3096f94da - Sigstore transparency entry: 167008373
- Sigstore integration time:
-
Permalink:
crickets-and-comb/comb_utils@95c1a4a97d87a99afe5f402488f2496d9deae134 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/crickets-and-comb
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI_CD.yml@95c1a4a97d87a99afe5f402488f2496d9deae134 -
Trigger Event:
workflow_dispatch
-
Statement type: