Rationale
These utilities are meant to help me with my python packages and their maintenance.
Dependencies
These utilities work best using the following opinionated dependencies
- Python virtual environments on a per project/repository basis
- direnv to set up the project virtual environment and any necessary environment variables
- Building using setup.py and the build module to create source and binary distributions. The documentation is here
- Using pypi for source and binary distributions
- A correctly setup $(HOME)/.pypirc for easy interaction with twine and pypi
Required Environment Variables
The above commands depend on the following environment variables.
PROJECTS_BASE - The local directory where the python projects are based
PROJECT - The name of the project; It should be a directory name
An example, of a PROJECTS_BASE is:
export PROJECTS_BASE="${HOME}/PycharmProjects"
This should be set in your shell startup script. For example .bash_profile.
The PROJECT environment variable should be set on a project by project basis. I recommend you use direnv to manage these. An example of a .envrc follows:
export PROJECT=buildlackey
source pyenv-3.13.14/bin/activate
Python Console Scripts
The Python command line scripts in buildlackey automate the maintenance process by providing the following capabilities
- unittests -- Runs the project's unit tests
- runmypy -- Run the mypy static type checker
- package -- Creates a pypi package using build and setup.py
- cleanup -- Deletes the artifacts created by
package
Usage
- unittests
Usage: unittests [OPTIONS]
Runs the unit tests for the project specified by the environment variables listed below.
This command differs from the 'runtests' command in that it uses the unit test TestLoader
discovery mechanism
Environment Variables
PROJECTS_BASE - The local directory where the python projects are based
PROJECT - The name of the project; It should be a directory name
However, if one or the other is not defined the command assumes it is executing in a CI
environment and thus the current working directory is the project base directory.
Legal values for -w/--warning are:
default
error
always
module
once
ignore This is the default
The default pattern is 'Test*.py'
Legal values for -v/--verbosity are:
quiet
default This is the default 🧐
verbose
loud
The -h/--html flag runs the HTMLTestRunner and places the reports in the
'html_unit_test_reports' directory
The -r/--report-name options names the HTML Test report
The -s/--source option specifies the project subdirectory where the Python
source code resides. The source default value is 'src'
Options:
--version Show the version and exit.
-w, --warning TEXT Use this option to control Python warnings
-v, --verbosity TEXT How verbose to be
-p, --pattern TEXT Test files that match pattern will be loaded
-h, --html Run the HTML rest runner
-r, --report-name TEXT The HTML test report name
-s, --source TEXT The project subdirectory where the source code
resides
--help Show this message and exit.
- runmypy
Usage: runmypy [OPTIONS]
Runs the mypy checks for the project specified by the following environment variables
PROJECTS_BASE - The local directory where the python projects are based
PROJECT - The name of the project; It should be a directory name
PROJECT is overridden if the developer specifies a package name
The -p/--package-name option to change the package name when it does not
much the project name
The -d/--delete-cache option allows the developer to delete the default mypy
cache prior to running the command
The -s/--source option specifies the project subdirectory where the Python
source code resides. The source default value is 'src'
Options:
--version Show the version and exit.
-p, --package-name TEXT Use this option when the package name does not
match the project name
-d, --delete-cache Delete .mypy_cache prior to running
-s, --source TEXT The project subdirectory where the source code
resides
--help Show this message and exit.
Written by Humberto A. Sanchez II (humberto.a.sanchez.ii@gmail.com)
- cleanup
Usage: cleanup [OPTIONS]
Clean the build artifacts for the project specified by the following environment variables
PROJECTS_BASE - The local directory where the python projects are based
PROJECT - The name of the project; It should be a directory name
PROJECT is overridden if the developer specifies a package name
Options:
--version Show the version and exit.
-p, --package-name TEXT Use this option when the package name does not
match the project name
-a, --application-name TEXT Use this option when the generated application
name does not match the project name
--help Show this message and exit.
- package
Usage: package [OPTIONS]
Creates the deployable for the project specified by the environment variables listed below
Use the -i/--input-file option to specify a set of custom commands to execute to build
your deployable
Environment Variables PROJECTS_BASE - The local directory where the
python projects are based PROJECT - The name of the project; It
should be a directory name
Options:
--version Show the version and exit.
-i, --input-file TEXT Use input file to specify a set of commands to
execute
--help Show this message and exit.
Written by Humberto A. Sanchez II (C) 2026
Note
For all kind of problems, requests, enhancements, bug reports, etc., please drop me an e-mail.
Release files for buildlackey 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| buildlackey-2.1.0.tar.gz | 24.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| buildlackey-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.1 kB
Release files / buildlackey-2.1.0.tar.gz
| Download URL | buildlackey-2.1.0.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c2d081eff1ff075ab77751a6e43285103e211fb69b67d0436c4217c4c109261
|
|
BLAKE2b-256 checksum How to use checksums |
9d8ab317e0ab5f84da32e543979c71ccff7df87462b566282b9ae104ca5dec72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency logRelease files / buildlackey-2.1.0-py3-none-any.whl
| Download URL | buildlackey-2.1.0-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
369e37c1ff718a940988d612aad974724bedd16394d6d85f30c8327de488da93
|
|
BLAKE2b-256 checksum How to use checksums |
0cf5587b0245f35dd84ea0ac292d6a390075c022f97e8ede09b8090d337af3ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency log