Name | reference-package JSON |
Version |
0.1.10
JSON |
| download |
home_page | None |
Summary | A basic package setup with examples. |
upload_time | 2024-11-30 04:24:04 |
maintainer | None |
docs_url | None |
author | Kaleb Coberly |
requires_python | >=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Basic package template
## Summary
Just a basic package template.
## Credit
I borrowed and modified the structure and tools from the idiomatic usage of IHME's Central Computation GBD team when I worked with them in 2023-2024.
## Structure
```bash
src/reference_package/api Public and internal API.
src/reference_package/cli Command-line-interface.
src/reference_package/lib Implementation.
tests/e2e End-to-end tests.
test/integration Integration tests.
tests/unit Unit tests.
```
## Dependencies
* Python 3.11
* [make](https://www.gnu.org/software/make/)
## Library functions
`reference_package` is a library from which you can import functions. Import the public example function like this: `from reference_package import wait_a_second`. Or, import the internal version like a power user like this: `from reference_package.api.internal import wait_a_second`.
Unless you're developing, avoid importing directly from library, like `from reference_package.lib.example import wait_a_second`.
## CLI
Try the example CLI:
$ python -m example
$ python -m example --secs 2
## 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 reference_package_py3.12
Then, install this package and its dev dependencies:
$ make install INSTALL_EXTRAS=[dev]
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.
## Dev workflow
You can list all the make tools you might want to use:
$ make list-targets
Go check them out in `Makefile`.
### 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
### CI test run
Before opening a PR or pushing to it, you'll want to run locally the same CI pipeline that GitHub will run (`.github/workflows/QC-and-build.yml`). This runs on multiple images, so you'll need to install Docker and have it running on your machine: https://www.docker.com/
Once that's installed and running, you can use `act`. You'll need to install that as well. I develop on a Mac, so I used `homebrew` to install it (which you'll also need to install: https://brew.sh/):
$ brew install act
Then, run it from the repo directory:
$ make ci-run
That will run `.github/workflows/QC-and-build.yml` and every other action tagged to the pull_request event. Also, since `act` doesn't work with Mac and Windows architecture, it skips/fails them, but it is a good test of the Linux build.
Raw data
{
"_id": null,
"home_page": null,
"name": "reference-package",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "kaleb.coberly@gmail.com",
"keywords": null,
"author": "Kaleb Coberly",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/9b/95/3983f507288df6b74382856bbb55b5d076b79a4d9f319beab25db018a971/reference_package-0.1.10.tar.gz",
"platform": null,
"description": "# Basic package template\n\n## Summary\n\nJust a basic package template.\n\n## Credit\n\nI borrowed and modified the structure and tools from the idiomatic usage of IHME's Central Computation GBD team when I worked with them in 2023-2024.\n\n## Structure\n\n```bash\n src/reference_package/api Public and internal API.\n src/reference_package/cli Command-line-interface.\n src/reference_package/lib Implementation.\n tests/e2e End-to-end tests.\n test/integration Integration tests.\n tests/unit Unit tests.\n```\n\n## Dependencies\n\n* Python 3.11\n* [make](https://www.gnu.org/software/make/)\n\n\n## Library functions\n\n`reference_package` is a library from which you can import functions. Import the public example function like this: `from reference_package import wait_a_second`. Or, import the internal version like a power user like this: `from reference_package.api.internal import wait_a_second`.\n\nUnless you're developing, avoid importing directly from library, like `from reference_package.lib.example import wait_a_second`.\n\n## CLI\n\nTry the example CLI:\n\n $ python -m example\n $ python -m example --secs 2\n\n## Dev installation\n\nYou'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.\n\nFirst build and activate the env before installing this package:\n\n $ make build-env\n $ conda activate reference_package_py3.12\n\nThen, install this package and its dev dependencies:\n\n $ make install INSTALL_EXTRAS=[dev]\n\nThis 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.\n\n## Dev workflow\n\nYou can list all the make tools you might want to use:\n\n $ make list-targets\n\nGo check them out in `Makefile`.\n\n### QC and testing\n\nBefore pushing commits, you'll usually want to rebuild the env and run all the QC and testing:\n\n $ make clean format full\n\nWhen making smaller commits, you might just want to run some of the smaller commands:\n\n $ make clean format full-qc full-test\n\n### CI test run\n\nBefore opening a PR or pushing to it, you'll want to run locally the same CI pipeline that GitHub will run (`.github/workflows/QC-and-build.yml`). This runs on multiple images, so you'll need to install Docker and have it running on your machine: https://www.docker.com/\n\nOnce that's installed and running, you can use `act`. You'll need to install that as well. I develop on a Mac, so I used `homebrew` to install it (which you'll also need to install: https://brew.sh/):\n\n $ brew install act\n\nThen, run it from the repo directory:\n\n $ make ci-run\n\nThat will run `.github/workflows/QC-and-build.yml` and every other action tagged to the pull_request event. Also, since `act` doesn't work with Mac and Windows architecture, it skips/fails them, but it is a good test of the Linux build.\n",
"bugtrack_url": null,
"license": null,
"summary": "A basic package setup with examples.",
"version": "0.1.10",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4e84219f1d257e9b2c647acb12de3b32e31588f3ae91f4172c75cb9119a0dbea",
"md5": "e0f268144939ab1bc3687cb69be51fa1",
"sha256": "fb03b33e17b90ecf78f7b5e60652fa6e3f0ec9fb6d231a35013f73eeb6939671"
},
"downloads": -1,
"filename": "reference_package-0.1.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0f268144939ab1bc3687cb69be51fa1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 6105,
"upload_time": "2024-11-30T04:23:47",
"upload_time_iso_8601": "2024-11-30T04:23:47.539161Z",
"url": "https://files.pythonhosted.org/packages/4e/84/219f1d257e9b2c647acb12de3b32e31588f3ae91f4172c75cb9119a0dbea/reference_package-0.1.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b953983f507288df6b74382856bbb55b5d076b79a4d9f319beab25db018a971",
"md5": "55471072c4f1c900c04fd5e8cf51b593",
"sha256": "5bc7ef5f9d173f0f7a4f20cdddc49b50299576ed42ee1492894208e3ab29a514"
},
"downloads": -1,
"filename": "reference_package-0.1.10.tar.gz",
"has_sig": false,
"md5_digest": "55471072c4f1c900c04fd5e8cf51b593",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 6447,
"upload_time": "2024-11-30T04:24:04",
"upload_time_iso_8601": "2024-11-30T04:24:04.487812Z",
"url": "https://files.pythonhosted.org/packages/9b/95/3983f507288df6b74382856bbb55b5d076b79a4d9f319beab25db018a971/reference_package-0.1.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-30 04:24:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "reference-package"
}