[![CircleCI](https://dl.circleci.com/status-badge/img/gh/hasii2011/buildlackey/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/hasii2011/buildlackey/tree/master)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[![PyPI version](https://badge.fury.io/py/buildlackey.svg)](https://badge.fury.io/py/buildlackey)
## 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](https://realpython.com/python-virtual-environments-a-primer/) on a per project/repository basis
* [direnv](https://direnv.net) to set up the project virtual environment and any necessary environment variables
* Building using setup.py and the [build](https://pypi.org/project/build/) module to create source and binary distributions. The documentation is [here](https://pypa-build.readthedocs.io/en/stable/)
* Using [pypi](https://pypi.org/) for source and binary distributions
* A correctly setup [$(HOME)/.pypirc](https://packaging.python.org/en/latest/specifications/pypirc/) for easy interaction with [twine](https://pypi.org/project/twine/) and [pypi](https://pypi.org/)
## Required Environment Variables
The above commands depend on the following environment variables.
```bash
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:
```bash
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](https://direnv.net) to manage these. An example of a .envrc follows:
```bash
export PROJECT=pyutmodel
source pyenv-3.10.6/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](https://www.mypy-lang.org) static type checker
* package -- Creates a pypi package using [build](https://pypi.org/project/build/) and setup.py
* cleanup -- Deletes the artifacts created by `package`
* prodpush -- Pushes the built package to [pypi](https://pypi.org)
## Usage
* unittests
```text
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
```text
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 -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
-s, --source TEXT The project subdirectory where the source code
resides
--help Show this message and exit.
```
* cleanup
```text
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
```text
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.
```
* prodpush
```text
Usage: prodpush [OPTIONS]
Pushes the deployable to pypi. The project is 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
Options:
--version Show the version and exit.
--help Show this message and exit.
```
___
Written by <a href="mailto:email@humberto.a.sanchez.ii@gmail.com?subject=Hello Humberto">Humberto A. Sanchez II</a> (C) 2025
---
## Note
For all kind of problems, requests, enhancements, bug reports, etc.,
please drop me an e-mail.
![Humberto's Modified Logo](https://raw.githubusercontent.com/wiki/hasii2011/gittodoistclone/images/SillyGitHub.png)
I am concerned about GitHub's Copilot project
I urge you to read about the[Give up GitHub](https://GiveUpGitHub.org) campaign from [the Software Freedom Conservancy](https://sfconservancy.org).
While I do not advocate for all the issues listed there I do not like that a company like Microsoft may profit from open source projects.
I continue to use GitHub because it offers the services I need for free. But, I continue to monitor their terms of service.
Any use of this project's code by GitHub Copilot, past or present, is done without my permission. I do not consent to GitHub's use of this project's code in Copilot.
Raw data
{
"_id": null,
"home_page": null,
"name": "buildlackey",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": "\"Humberto A. Sanchez II\" <Humbert.A.Sanchez.II@gmail.com>",
"keywords": "developer, python",
"author": null,
"author_email": "\"Humberto A. Sanchez II\" <Humbert.A.Sanchez.II@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/80/b9/0647649c7d9316b49639489295b0d1d9ff3715017bfed2247694143b37a7/buildlackey-1.8.1.tar.gz",
"platform": null,
"description": "[![CircleCI](https://dl.circleci.com/status-badge/img/gh/hasii2011/buildlackey/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/hasii2011/buildlackey/tree/master)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\n[![PyPI version](https://badge.fury.io/py/buildlackey.svg)](https://badge.fury.io/py/buildlackey)\n\n## Rationale\n\nThese utilities are meant to help me with my python packages and their maintenance.\n\n## Dependencies\n\nThese utilities work best using the following opinionated dependencies\n\n* Python [virtual environments](https://realpython.com/python-virtual-environments-a-primer/) on a per project/repository basis\n* [direnv](https://direnv.net) to set up the project virtual environment and any necessary environment variables\n* Building using setup.py and the [build](https://pypi.org/project/build/) module to create source and binary distributions. The documentation is [here](https://pypa-build.readthedocs.io/en/stable/)\n* Using [pypi](https://pypi.org/) for source and binary distributions\n* A correctly setup [$(HOME)/.pypirc](https://packaging.python.org/en/latest/specifications/pypirc/) for easy interaction with [twine](https://pypi.org/project/twine/) and [pypi](https://pypi.org/)\n\n## Required Environment Variables\n\nThe above commands depend on the following environment variables.\n\n```bash\nPROJECTS_BASE - The local directory where the python projects are based\nPROJECT - The name of the project; It should be a directory name\n```\n\n An example, of a PROJECTS_BASE is:\n\n```bash\nexport PROJECTS_BASE=\"${HOME}/PycharmProjects\" \n```\n\nThis should be set in your shell startup script. For example `.bash_profile`.\n\nThe PROJECT environment variable should be set on a project by project basis. I recommend you use [direnv](https://direnv.net) to manage these. An example of a .envrc follows:\n\n```bash\nexport PROJECT=pyutmodel\nsource pyenv-3.10.6/bin/activate\n```\n\n\n## Python Console Scripts\n\nThe Python command line scripts in buildlackey automate the maintenance process by providing the following capabilities\n\n* unittests -- Runs the project's unit tests\n* runmypy -- Run the [mypy](https://www.mypy-lang.org) static type checker \n* package -- Creates a pypi package using [build](https://pypi.org/project/build/) and setup.py \n* cleanup -- Deletes the artifacts created by `package`\n* prodpush -- Pushes the built package to [pypi](https://pypi.org)\n\n## Usage\n\n* unittests\n```text\nUsage: unittests [OPTIONS]\n\n Runs the unit tests for the project specified by the environment variables listed below.\n This command differs from the 'runtests' command in that it uses the unit test TestLoader\n discovery mechanism\n\n Environment Variables\n\n PROJECTS_BASE - The local directory where the python projects are based\n PROJECT - The name of the project; It should be a directory name\n\n However, if one or the other is not defined the command assumes it is executing in a CI\n environment and thus the current working directory is the project base directory.\n \n Legal values for -w/--warning are:\n\n default\n error\n always\n module\n once\n ignore This is the default\n \n The default pattern is 'Test*.py'\n \n Legal values for -v/--verbosity are:\n quiet\n default This is the default \ud83e\uddd0\n verbose\n loud\n\n The -h/--html flag runs the HTMLTestRunner and places the reports in the\n 'html_unit_test_reports' directory\n\n The -r/--report-name options names the HTML Test report\n\n The -s/--source option specifies the project subdirectory where the Python\n source code resides. The source default value is 'src' \n\nOptions:\n --version Show the version and exit.\n -w, --warning TEXT Use this option to control Python warnings\n -v, --verbosity TEXT How verbose to be\n -p, --pattern TEXT Test files that match pattern will be loaded\n -h, --html Run the HTML rest runner\n -r, --report-name TEXT The HTML test report name\n -s, --source TEXT The project subdirectory where the source code\n resides\n --help Show this message and exit.\n\n```\n\n* runmypy\n```text\nUsage: runmypy [OPTIONS]\n\n Runs the mypy checks for the project specified by the following environment variables\n \n PROJECTS_BASE - The local directory where the python projects are based\n PROJECT - The name of the project; It should be a directory name\n\n PROJECT is overridden if the developer specifies a package name\n\n The -s/--source option specifies the project subdirectory where the Python\n source code resides. The source default value is 'src'\n\nOptions:\n --version Show the version and exit.\n -p, --package-name TEXT Use this option when the package name does not\n match the project name\n -s, --source TEXT The project subdirectory where the source code\n resides\n --help Show this message and exit.\n```\n* cleanup\n\n```text\nUsage: cleanup [OPTIONS]\n\n Clean the build artifacts for the project specified by the following environment variables\n \n PROJECTS_BASE - The local directory where the python projects are based\n PROJECT - The name of the project; It should be a directory name\n\n PROJECT is overridden if the developer specifies a package name\n\nOptions:\n --version Show the version and exit.\n -p, --package-name TEXT Use this option when the package name does not\n match the project name\n -a, --application-name TEXT Use this option when the generated application\n name does not match the project name\n --help Show this message and exit.\n\n```\n\n* package\n```text\nUsage: package [OPTIONS]\n\n Creates the deployable for the project specified by the environment variables listed below\n \n Use the -i/--input-file option to specify a set of custom commands to execute to build\n your deployable\n\n Environment Variables PROJECTS_BASE - The local directory where the\n python projects are based PROJECT - The name of the project; It\n should be a directory name\n\nOptions:\n --version Show the version and exit.\n -i, --input-file TEXT Use input file to specify a set of commands to\n execute\n --help Show this message and exit.\n\n```\n* prodpush\n```text\nUsage: prodpush [OPTIONS]\n\n Pushes the deployable to pypi. The project is specified by the following environment variables\n \n PROJECTS_BASE - The local directory where the python projects are based\n PROJECT - The name of the project; It should be a directory name\n\nOptions:\n --version Show the version and exit.\n --help Show this message and exit.\n\n```\n\n___\n\nWritten by <a href=\"mailto:email@humberto.a.sanchez.ii@gmail.com?subject=Hello Humberto\">Humberto A. Sanchez II</a> (C) 2025\n\n---\n\n## Note\nFor all kind of problems, requests, enhancements, bug reports, etc.,\nplease drop me an e-mail.\n\n\n![Humberto's Modified Logo](https://raw.githubusercontent.com/wiki/hasii2011/gittodoistclone/images/SillyGitHub.png)\n\nI am concerned about GitHub's Copilot project\n\n\n\nI urge you to read about the[Give up GitHub](https://GiveUpGitHub.org) campaign from [the Software Freedom Conservancy](https://sfconservancy.org).\n\nWhile I do not advocate for all the issues listed there I do not like that a company like Microsoft may profit from open source projects.\n\nI continue to use GitHub because it offers the services I need for free. But, I continue to monitor their terms of service.\n\nAny use of this project's code by GitHub Copilot, past or present, is done without my permission. I do not consent to GitHub's use of this project's code in Copilot.\n\n",
"bugtrack_url": null,
"license": "GNU AFFERO GENERAL PUBLIC LICENSE",
"summary": "Project Maintenance Scripts",
"version": "1.8.1",
"project_urls": {
"Repository": "https://github.com/hasii2011/buildlackey"
},
"split_keywords": [
"developer",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "19e25864b8c3dee686aec0d3d8e90834a2780fd97b6e7fb774d6d4a191a34862",
"md5": "159f4cd56fe0cd994a38ec22bfeaa872",
"sha256": "16e3d5570350ce3ac22f775eaa94018b6080ccee5faa5f0e31b8b0b7fd91613d"
},
"downloads": -1,
"filename": "buildlackey-1.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "159f4cd56fe0cd994a38ec22bfeaa872",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 26794,
"upload_time": "2025-01-21T18:26:01",
"upload_time_iso_8601": "2025-01-21T18:26:01.362160Z",
"url": "https://files.pythonhosted.org/packages/19/e2/5864b8c3dee686aec0d3d8e90834a2780fd97b6e7fb774d6d4a191a34862/buildlackey-1.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80b90647649c7d9316b49639489295b0d1d9ff3715017bfed2247694143b37a7",
"md5": "9859c3b0c4437ed74c64740a435f890a",
"sha256": "df6f733f53613e874f223f73b79fd43d6aa44ceb498e23ae532fa8ebf15399ac"
},
"downloads": -1,
"filename": "buildlackey-1.8.1.tar.gz",
"has_sig": false,
"md5_digest": "9859c3b0c4437ed74c64740a435f890a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 25026,
"upload_time": "2025-01-21T18:26:03",
"upload_time_iso_8601": "2025-01-21T18:26:03.506580Z",
"url": "https://files.pythonhosted.org/packages/80/b9/0647649c7d9316b49639489295b0d1d9ff3715017bfed2247694143b37a7/buildlackey-1.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-21 18:26:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hasii2011",
"github_project": "buildlackey",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"circle": true,
"lcname": "buildlackey"
}