{"id":15913154,"url":"https://github.com/34j/pypackage-template-fork","last_synced_at":"2025-03-22T19:34:41.882Z","repository":{"id":113570620,"uuid":"604007942","full_name":"34j/pypackage-template-fork","owner":"34j","description":"Project template for a Python Package using Copier. [autoflake, sphinx-autodoc, CC0 support, \"and conrtibutors\", repo settings, Python 3.8+, venv creation, more Windows friendly] `copier copy --trust \"gh:34j/pypackage-template-fork\" \u003cname\u003e`","archived":false,"fork":false,"pushed_at":"2024-09-30T17:06:47.000Z","size":767,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-06T16:23:31.168Z","etag":null,"topics":["cookiecutter","cookiecutter-template","copier","copier-template","github","package","package-template","poetry","poetry-python","pypi","python"],"latest_commit_sha":null,"homepage":"https://github.com/browniebroke/pypackage-template","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/34j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-20T06:13:11.000Z","updated_at":"2024-08-19T20:48:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"381568b8-66cb-4677-8364-5b8c7e84094a","html_url":"https://github.com/34j/pypackage-template-fork","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpypackage-template-fork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpypackage-template-fork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpypackage-template-fork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpypackage-template-fork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/34j","download_url":"https://codeload.github.com/34j/pypackage-template-fork/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221837088,"owners_count":16889206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cookiecutter","cookiecutter-template","copier","copier-template","github","package","package-template","poetry","poetry-python","pypi","python"],"created_at":"2024-10-06T16:23:19.570Z","updated_at":"2024-10-28T14:05:33.262Z","avatar_url":"https://github.com/34j.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Package Template\n\n\u003ca href=\"https://github.com/browniebroke/pypackage-template/actions/workflows/ci.yml?query=branch%3Amain\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/browniebroke/pypackage-template/ci.yml?branch=main\u0026label=Test\u0026logo=github\u0026style=flat-square\" alt=\"CI Status\" \u003e\n\u003c/a\u003e\n\nProject template for a Python Package using Copier.\n\n## Features\n\n- Project for Python 3.8+.\n- Testing with Pytest using Github actions.\n- Packaging powered by [poetry]\n- Follows the [black] style guide with [flake8] and [isort], [autoflake].\n- Comes with [pre-commit] hook config for black, isort, flake8 and [pyupgrade](https://github.com/asottile/pyupgrade).\n- Style guide enforced on CI.\n- Dependencies kept up to date by [Renovate].\n- Follow the [all-contributors] specification.\n- Follow to [the conventional commits][conventional-commits] specification.\n- Automated releasing using [python-semantic-release][python-semantic-release].\n- Documentation configured with Sphinx and [MyST Parser][myst].\n- Standardised list of GitHub labels synchronised on push to master using [the labels CLI][pylabels].\n\n## Quickstart\n\n```shell\ncopier copy --trust \"gh:34j/pypackage-template-fork\" \u003cpath\u003e\n```\n\nBranches/`main`/Branch protection rules\n\n- [x] Allow force pushes\n\nActions/General/Workflow permissions\n\n- [x] Read and write permissions\n\nSecrets and variables/Actions/Repository secrets\n\ngo to [Applications][gh-applications] and set up Renovate\n\ngo to [codecov.io][codecov] and copy CODECOV_TOKEN and add it\n\ngo to [Read the Docs][rtd-dashboard] and add the project\n\nset up [pre-commit-ci][pre-commit-ci]\n\n### Update\n\n```shell\ncopier --force update\n```\n\n## Usage\n\nGenerate a new project with:\n\n```shell\ncopier copy --trust \"gh:34j/pypackage-template-fork\" \u003cname\u003e\n```\n\nThis will prompt you for a few questions and create new directory with the name you used as project slug.\n\n\u003e _Note:_\n\u003e the `--trust` option is required because this template may execute some tasks after generating the project, like initialising the git repo, installing dependencies and so forth. These are all listed in the `copier.yml` of this repo, under the `_tasks` key. They are all optional and safe to run. You can take my word for it, or better, check the code yourself!\n\n### Start developing\n\nThe project uses [Poetry] for dependencies management and packaging. Make sure you have it installed in your development machine. To install the development dependencies in a virtual environment, type:\n\n```shell\npoetry install\n```\n\nThis will also generate a `poetry.lock` file, you should track this file in version control. To execute the test suite, call pytest inside Poetry's virtual environment via `poetry run`:\n\n```shell\npoetry run pytest\n```\n\nCheck out the [Poetry] documentation for more information on the available commands.\n\n### GitHub Actions\n\nWhen you first push to GitHub, it'll start a `ci` GitHub workflow that you can see in the \"Actions\" tab of your repository. This workflow runs a couple of jobs:\n\n- The `test` job will run your test suite with Pytest against all Python version from 3.8 to 3.11\n- A few things will run in the lint job:\n  - black in check mode\n  - isort in check mode\n  - flake8\n  - pyupgrade for Python 3.8+\n\nA `labels` workflow will also run and synchronise the GitHub labels based on the `.github/labels.toml` file.\n\n### Secrets\n\nThe workflows need [a few secrets][gh-secrets] to be setup in your GitHub repository:\n\n- `PYPI_TOKEN` to publish releases to [PyPI][pypi]. This one should be created as `release` environment secret.\n- `GH_PAT` a [personal access token (PAT) with the `repo` scope][create-pat] for opening pull requests and updating the repository topics. This is used by the `hacktoberfest` workflow.\n- `CODECOV_TOKEN` to upload coverage data to [codecov.io][codecov] in the Test workflow (optional for public repos).\n\nIf you have the GitHub CLI installed and chose to set up GitHub, they will be created with a dummy value.\n\n### Automated release\n\nBy following the conventional commits specification, we're able to completely automate versioning and releasing to PyPI. This is handled by the `semantic-release.yml` workflow. It is triggered manually by default, but can be configured to run on every push to your main branch.\n\nHere is an overview of its features:\n\n- Check the commit log since the last release, and determine the next version to be released.\n- If no significant change detected, stop here (e.g. just dependencies update).\n- Otherwise, bump the version in code locations specified in `setup.cfg`.\n- Update the `CHANGELOG.md` file.\n- Commit changes.\n- Create a git tag.\n- Push to GitHub.\n- Create a release in GitHub with the changes as release notes.\n- Build the source and binary distribution (wheel).\n- Upload the sources to PyPI and attach them to the Github release.\n\nFor more details, check out the [conventional commits website][conventional-commits] and [Python semantic release][python-semantic-release] Github action.\n\n### Pre-commit\n\nThe project comes with the config for [pre-commit]. If you're not familiar with it, follow their documentation on how to install it and set it up.\n\n### Documentation\n\nThe project assumes that the documentation will be hosted on Read the Docs and written in Markdown with the [MyST parser for Sphinx][myst].\n\nTo enable it, you might need to go [into your dashboard][rtd-dashboard] and import the project from Github. Everything else should work out of the box.\n\n### Dependencies update\n\nThe project dependencies are kept up to date with [Renovate] which requires [the Github app][renovate-gh-app] to be installed.\n\nThe main advantage of Renovate over Dependabot is the auto-merge option, which is configured to automatically merge minor/patch updates with all the CI checks passing. It supports a variety of package managers, including Poetry, GitHub actions and pre-commit hooks which are used by default.\n\n### All contributors\n\nThis is a specification that help you highlight every open source contribution in your README. This is easy to maintain as it comes with a GitHub bot to do the updates for you, so more manual updates on the contributors file.\n\nIf you never used it before, you will have to [install the Github app][all-contribs-install] and give it access to your repo.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://browniebroke.com/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/861044?v=4?s=80\" width=\"80px;\" alt=\"Bruno Alla\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBruno Alla\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/pypackage-template/commits?author=browniebroke\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-browniebroke\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/browniebroke/pypackage-template/commits?author=browniebroke\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://cloudreactor.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1079646?v=4?s=80\" width=\"80px;\" alt=\"Jeff Tsay\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJeff Tsay\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/pypackage-template/commits?author=jtsay362\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/34j\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/55338215?v=4?s=80\" width=\"80px;\" alt=\"34j\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e34j\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/pypackage-template/commits?author=34j\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kroimon\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/628587?v=4?s=80\" width=\"80px;\" alt=\"Stefan Rado\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStefan Rado\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/pypackage-template/commits?author=kroimon\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n[poetry]: https://python-poetry.org/\n[black]: https://github.com/psf/black\n[flake8]: https://pypi.org/project/flake8/\n[isort]: https://pypi.org/project/isort/\n[autoflake]: https://pypi.org/project/autoflake/\n[pre-commit]: https://pre-commit.com/\n[renovate]: https://docs.renovatebot.com/\n[renovate-gh-app]: https://github.com/apps/renovate\n[all-contributors]: https://github.com/all-contributors/all-contributors\n[conventional-commits]: https://www.conventionalcommits.org\n[python-semantic-release]: https://github.com/relekang/python-semantic-release\n[myst]: https://myst-parser.readthedocs.io\n[pylabels]: https://github.com/hackebrot/labels\n[gh-secrets]: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets\n[codecov]: https://codecov.io/\n[pypi]: https://pypi.org/\n[create-pat]: https://github.com/settings/tokens/new?scopes=repo\n[rtd-dashboard]: https://readthedocs.org/dashboard/\n[all-contribs-install]: https://allcontributors.org/docs/en/bot/installation\n[pre-commit-ci]: https://pre-commit.ci/\n[gh-applications]: https://github.com/settings/installations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F34j%2Fpypackage-template-fork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F34j%2Fpypackage-template-fork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F34j%2Fpypackage-template-fork/lists"}