diff --git a/.github/workflows/main_release.yaml b/.github/workflows/main_release.yaml index 6e8abde..4f3fc95 100644 --- a/.github/workflows/main_release.yaml +++ b/.github/workflows/main_release.yaml @@ -1,17 +1,13 @@ name: 🐍 + 📦 => PyPI on: - # workflow_run: - # workflows: ["Tests"] - # branches: [main] - # types: - # - completed - push: - branches: - - "main" + workflow_run: + workflows: ["Tests"] + branches: [main] + types: + - completed jobs: - release: runs-on: ubuntu-latest concurrency: release @@ -21,7 +17,7 @@ jobs: contents: write environment: - name: pypi + name: pypi-release url: https://pypi.org/p/python-project-cli steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4172da4..ab94754 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,11 +4,11 @@ on: push: branches: - 'development' - # - 'main' + - 'main' pull_request: branches: - 'development' - # - 'main' + - 'main' jobs: test: @@ -16,7 +16,6 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - # python-version: ['3.10', '3.11', '3.12'] python-version: ['3.11'] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 886616b..e69de29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,285 +0,0 @@ -# CHANGELOG - - - -## v0.5.0 (2024-05-14) - -### Feature - -* feat: Fix semantic release 3 ([`30d48fc`](https://github.com/MentorMate/python-project-cli/commit/30d48fc20fe9134e0962764c771667b389fdcb74)) - - -## v0.4.0 (2024-05-14) - -### Feature - -* feat: Fix semantic release 2 ([`2f69be2`](https://github.com/MentorMate/python-project-cli/commit/2f69be200da26055d1caac1cae32de571cde65d5)) - -### Unknown - -* Merge branch 'main' of github.com:MentorMate/python-project-cli ([`dbe4588`](https://github.com/MentorMate/python-project-cli/commit/dbe458801144a2cd7905be01e2b82930ff7c6405)) - - -## v0.3.0 (2024-05-14) - -### Feature - -* feat: Fix semantic release ([`eefc51b`](https://github.com/MentorMate/python-project-cli/commit/eefc51b066278e74df63ca684f99c4265638dd46)) - -* feat: Fix semantic release ([`94709af`](https://github.com/MentorMate/python-project-cli/commit/94709af513e449f8587c2ea004bd86b4cbad9ebf)) - -* feat: Uncomment semantic-release ([`68a6692`](https://github.com/MentorMate/python-project-cli/commit/68a669216032c49faad71061539638e682594cdb)) - -* feat: Trigger release without automatic tag generation ([`97a40dc`](https://github.com/MentorMate/python-project-cli/commit/97a40dcd79f9974554b96c220bfd801deb163543)) - - -## v0.2.0 (2024-05-14) - -### Chore - -* chore: Update poetry.lock ([`efa051c`](https://github.com/MentorMate/python-project-cli/commit/efa051c57a0aafe131684ee05c68048cdb82bc09)) - -### Feature - -* feat: Test deploy from trusted publisher ([`d4f3619`](https://github.com/MentorMate/python-project-cli/commit/d4f36194f87a1db4f9f82f85a544d7ac621a9226)) - -### Unknown - -* Merge pull request #18 from MentorMate/feature/pypi-release-config-3 - -feat: Test deploy from trusted publisher ([`d7183c4`](https://github.com/MentorMate/python-project-cli/commit/d7183c4ac8542c47c7fe6ed428b712c9c9023ddd)) - - -## v0.1.0 (2024-05-13) - -### Chore - -* chore: Remove example pytest files ([`e008957`](https://github.com/MentorMate/python-project-cli/commit/e0089571e56411ddd962d71e58a52f37dc2f51a1)) - -* chore: Add typer to poetry; Update poetry.lock ([`a4eece8`](https://github.com/MentorMate/python-project-cli/commit/a4eece88dadaebc8088243bd1b166b5ae3a5cb31)) - -* chore: Update the pre-commit to call hooks from poetry ([`fb0a2ed`](https://github.com/MentorMate/python-project-cli/commit/fb0a2edec3886ab534723002b7608a7326e19bf6)) - -### Ci - -* ci: Remove repository-url ([`b3d6995`](https://github.com/MentorMate/python-project-cli/commit/b3d69955e1aec8af8548417fcd3fc8e3029f91dc)) - -* ci: Remove python versions 3.10 and 3.12 from pyproject.toml classifiers ([`5ab7ecd`](https://github.com/MentorMate/python-project-cli/commit/5ab7ecdd28242c0066341ea6ca6370a1c0ee1f7c)) - -* ci: Create workflow for pypi release ([`26cff70`](https://github.com/MentorMate/python-project-cli/commit/26cff70aa515490e1741fb5cf64265f751f5cb35)) - -* ci: Separate the release and publish jobs ([`893c27d`](https://github.com/MentorMate/python-project-cli/commit/893c27d30fb156ff6747d97109ac958d9d7fb569)) - -* ci: Clean the commented code from the workflows; Uncomment the tests ([`fd55c50`](https://github.com/MentorMate/python-project-cli/commit/fd55c5093effe642cf5223066ea00798bb160244)) - -* ci: Test skip publish package ([`e52f1a9`](https://github.com/MentorMate/python-project-cli/commit/e52f1a94aefe9437487f54c57727c2e3c9e91b78)) - -* ci: Test skip publish package ([`b5b5132`](https://github.com/MentorMate/python-project-cli/commit/b5b51324724f9d8258cc9e68b8a6594babeca311)) - -* ci: Test skip publish package ([`a70b741`](https://github.com/MentorMate/python-project-cli/commit/a70b7410a4eb4e03807f72fd9b6a07c68ebc2fe2)) - -* ci: Test skip release job ([`4dee22e`](https://github.com/MentorMate/python-project-cli/commit/4dee22ec328b605ec7bf60ebc66120a2fe0462ff)) - -* ci: Test pypi publish with new setup ([`754c1d6`](https://github.com/MentorMate/python-project-cli/commit/754c1d657fad3b954d80e8c0cc3ff1ad1839d36b)) - -* ci: Test alternative configurations ([`d5d5452`](https://github.com/MentorMate/python-project-cli/commit/d5d54526a0f7dbbcaae4837c4744a130977245a8)) - -* ci: Update version ([`440392b`](https://github.com/MentorMate/python-project-cli/commit/440392b7087db45c7971c58a74565a2c059ab916)) - -* ci: Optimise the CI process ([`1817176`](https://github.com/MentorMate/python-project-cli/commit/1817176e5a70a992199a27cf3632d523ae05b2b9)) - -* ci: Optimise the CI process ([`65f6958`](https://github.com/MentorMate/python-project-cli/commit/65f6958ca38adfe548af073f4af7aecd545006fe)) - -* ci: Optimise the CI process ([`4881d20`](https://github.com/MentorMate/python-project-cli/commit/4881d20b865c02eb12a5772b33ef765f754be745)) - -### Documentation - -* docs: Reset CHANGELOG ([`75c3b49`](https://github.com/MentorMate/python-project-cli/commit/75c3b492db694c75f6f8b664e665d829e603f423)) - -* docs: Update the documentation with the basic commands ([`7128e51`](https://github.com/MentorMate/python-project-cli/commit/7128e510300230f92fc1cac6092d956af61bf9eb)) - -* docs: Update README.md with notes on how to use python-semantic-release and poetry ([`f5cb529`](https://github.com/MentorMate/python-project-cli/commit/f5cb52998b362eeebf4aeed607e3e6434bcac38c)) - -* docs: Edit the deploy reference ([`3df54b9`](https://github.com/MentorMate/python-project-cli/commit/3df54b93a4dbefab5528ac554e2abeefc9b5d19f)) - -### Feature - -* feat: Trigger feature release ([`d973551`](https://github.com/MentorMate/python-project-cli/commit/d9735510980cb9f84a14be170e9ff1d80ee470fc)) - -* feat: Create an alias called python-cli for more convenient cli access ([`d6d3ede`](https://github.com/MentorMate/python-project-cli/commit/d6d3ede5f039ceec72d83befd0c880e88388d25c)) - -* feat: Create typer cli commands: generate, version and status ([`5f503e7`](https://github.com/MentorMate/python-project-cli/commit/5f503e7cdc43d6a19a76f1f9504ae3b6a74bf63f)) - -* feat: Add cookiecutter library ([`24424e9`](https://github.com/MentorMate/python-project-cli/commit/24424e9ce6bca582ccdf875b05360145ed1f8236)) - -* feat: Add base typer example code; Separate the ruff check and format in the pre-commit yaml ([`71723e1`](https://github.com/MentorMate/python-project-cli/commit/71723e101421971df819bae7edb21882e3486c5d)) - -* feat: Update README.md; Trigger new feature release after the project seetings changes ([`2908b72`](https://github.com/MentorMate/python-project-cli/commit/2908b723c04532e26fb4ba6595d9fc4ffa0e93c4)) - -* feat: Important feature added ([`133897b`](https://github.com/MentorMate/python-project-cli/commit/133897bd1942dbe498a4a45fc448ebfd50987557)) - -* feat: Test deploy ([`a3b8dee`](https://github.com/MentorMate/python-project-cli/commit/a3b8dee786b55c9d41c54299484d2007b0e03a2e)) - -* feat: Add divide_by_two test feature ([`a3945a9`](https://github.com/MentorMate/python-project-cli/commit/a3945a9e5c58ebfc9584bbb9297a3b8d8ac5725a)) - -* feat: Update package version ([`85c7339`](https://github.com/MentorMate/python-project-cli/commit/85c733992226d8698d264eeed91e7ad35033b8a7)) - -### Fix - -* fix: Remove the mock project directories and files ([`e7b3d1c`](https://github.com/MentorMate/python-project-cli/commit/e7b3d1c5a43ebd5d3ba418361733ac01060b6589)) - -* fix: Update the README title; Force patch release ([`6057a53`](https://github.com/MentorMate/python-project-cli/commit/6057a53454e47ca3159fa08aadfacbdc62b48e36)) - -* fix: Simple semantic-release config test ([`6e7c296`](https://github.com/MentorMate/python-project-cli/commit/6e7c296905e95390934d5350718ce5e67c7fda11)) - -* fix: Remove invalid classifier ([`0600fee`](https://github.com/MentorMate/python-project-cli/commit/0600fee4f1108d0190d3b469d4516f1361177b47)) - -* fix: Include explicit branch config for semantic release ([`4d6b324`](https://github.com/MentorMate/python-project-cli/commit/4d6b324ce86cb01437147113e37cbd2f42dbad9c)) - -* fix: Uncomment the build step, because of missing dist/ ([`85247f9`](https://github.com/MentorMate/python-project-cli/commit/85247f9ecd0bd9927a66ce234ebd83ea582aec50)) - -* fix: Include missing parameters for the 'Publish package' step ([`6d020e4`](https://github.com/MentorMate/python-project-cli/commit/6d020e476ebf280e1c2b2f1991fe014fa94deee1)) - -* fix: Include personal access token for the failing step in the publish workflow; Skip tests workflow ([`e173803`](https://github.com/MentorMate/python-project-cli/commit/e1738039c264e1e3d6cb60adcaecab10092debce)) - -* fix: Fix missing version for the release step ([`9220338`](https://github.com/MentorMate/python-project-cli/commit/92203380d61084f5accddbcee74df690239fbc6c)) - -### Test - -* test: Limit the test_status, because it's not passing in tox environemnt ([`13e39e4`](https://github.com/MentorMate/python-project-cli/commit/13e39e40547de3a0f9b1ad0ce37ce8150fae4d71)) - -* test: Add unit tests for the new cli commands ([`702bacf`](https://github.com/MentorMate/python-project-cli/commit/702bacfb55eabae49e4e0ed68d148965f45607bd)) - -### Unknown - -* Merge pull request #17 from MentorMate/feature/pypi-release-config-2 - -Feature/pypi release config 2 ([`8a31b47`](https://github.com/MentorMate/python-project-cli/commit/8a31b476604d46846840a65411a458a128f10ed9)) - -* Merge pull request #16 from MentorMate/feature/pypi-release-config - -ci: Remove python versions 3.10 and 3.12 from pyproject.toml classifiers ([`2d7930b`](https://github.com/MentorMate/python-project-cli/commit/2d7930b86909267fb5a6022988d38f672238fdcb)) - -* Merge pull request #15 from MentorMate/development - -Include main branch in pyproject.toml ([`0e50cab`](https://github.com/MentorMate/python-project-cli/commit/0e50cab26f529cbd710e93af2b0f01cf24d4e67f)) - -* Include main branch in pyproject.toml ([`257ca7f`](https://github.com/MentorMate/python-project-cli/commit/257ca7f0f5d3aba193a7403c77bfc8c1a92265a4)) - -* Merge pull request #14 from MentorMate/development - -Rename master branch to main; Remove testpypi deploy ([`c648ed3`](https://github.com/MentorMate/python-project-cli/commit/c648ed3a31de875a28babaaf3744ebee19f01870)) - -* Rename master branch to main; Remove testpypi deploy ([`6780c2b`](https://github.com/MentorMate/python-project-cli/commit/6780c2b565e91d79a0aa8c1c1274ec699d2223e2)) - -* Merge pull request #13 from MentorMate/development - -Release v.0.1.0 ([`8ec046c`](https://github.com/MentorMate/python-project-cli/commit/8ec046cb644a424d7e8d9434af96ceaa466304b3)) - -* Merge pull request #12 from MentorMate/feature/ebctn-490 - -Feature/ebctn 490 ([`7b7d112`](https://github.com/MentorMate/python-project-cli/commit/7b7d112ddb2410286baf19fdd3cb98a33513e0ea)) - -* Reset CHANGELOG ([`744c905`](https://github.com/MentorMate/python-project-cli/commit/744c905bfbf29274950bec6311208323ba564951)) - -* Merge branch 'development' into feature/ebctn-490 ([`5015b97`](https://github.com/MentorMate/python-project-cli/commit/5015b9757d07c3894e00f92f8f48eb49ff137bd2)) - -* Update LICENSE from MIT to UNLICENSED ([`4b55e3a`](https://github.com/MentorMate/python-project-cli/commit/4b55e3a0e27e67ce65a48b7871bcdf68fa56fd84)) - -* Merge pull request #11 from MentorMate/feature/ebctn-489 - -Feature/ebctn 489 ([`e831a4f`](https://github.com/MentorMate/python-project-cli/commit/e831a4f35b6c89ba92e04595393b853c6d80a212)) - -* Merge pull request #10 from MentorMate/feature/exclude-squash-merging-docs - -feat: Update README.md; Trigger new feature release after the project… ([`60ea5ee`](https://github.com/MentorMate/python-project-cli/commit/60ea5eeb6939d5da9b8d7f1c96f13e486d183346)) - -* Feature/integrate ruff (#8) - -* Include Georgi Peneve in codeowners - -* feat: include ruff and replace flake8 - -* docs: Fix typo in README.md - -* chore: Include option to allow semant-release version check on a feature branch; Remove unnecessary comments ([`b598a9d`](https://github.com/MentorMate/python-project-cli/commit/b598a9de6c538e3c294927d4b25c168ab809dff1)) - -* Revert "ci: Separate the release and publish jobs" - -This reverts commit 893c27d30fb156ff6747d97109ac958d9d7fb569. ([`c54435f`](https://github.com/MentorMate/python-project-cli/commit/c54435fcbd9e36e4775f6a99604d849abc2ad373)) - -* Update package version ([`b230adc`](https://github.com/MentorMate/python-project-cli/commit/b230adce59c56464e4fbb5266a6e730774334dc4)) - -* Merge branch 'development' of github.com:MentorMate/python-project-cli into development ([`50559ec`](https://github.com/MentorMate/python-project-cli/commit/50559ec0b159d3b5b43dee6f129b8240dddc1c63)) - -* Feature/poetry migration (#7) - -* docs: Include CHANGELOG.md - -* chore: Remove setup.cfg and setup.py - -* feat: Migrate to poetry; Exclude python v310 and 312 until v1.0.0 - -* fix: Fix imports - -* feat: Edit the existing build+deploy configurations for gh actions to accommodated semantic-release; Remove requirements_dev.txt - -* fix: Fix gh actions tests workflow to properly call tox with poetry ([`7d362a7`](https://github.com/MentorMate/python-project-cli/commit/7d362a7759a0214ba4c8273edd9d4aa33099a0a5)) - -* Feature/semantic release (#6) - -* feat: Include python-semantic-release with initial configurations for ci/cd package publishing - -* docs: Update README ([`294ca65`](https://github.com/MentorMate/python-project-cli/commit/294ca651c48bd74fcf166941ba69c5a38c1b4fa8)) - -* Update package version ([`df2c891`](https://github.com/MentorMate/python-project-cli/commit/df2c8916648430491b2286f4061f6cb2a794ffbc)) - -* Feature/ci cd pypi workflow (#5) - -* Add Dani in CODEOWNERS - -* Create new github workflow for test.pypi deployment ([`ee4bf1b`](https://github.com/MentorMate/python-project-cli/commit/ee4bf1b859d1d71aa0db954e4f63bbfb76c8d7da)) - -* Feature/ci cd pipeline (#4) - -* Add github action workflow for running tests wtih tox - -* Create .github/CODEOWNERS file - -* Edit the gothub workflow tests to target only main and development branches; Update README.md ([`28225de`](https://github.com/MentorMate/python-project-cli/commit/28225dead92c9b6c6425b224eeda5b7b876dba80)) - -* Feature/accommodate pre commit (#3) - -* Include .pre-commit-config.yaml - -* Update the README.md with setup isntallation for maintenance ([`7967b4e`](https://github.com/MentorMate/python-project-cli/commit/7967b4ec73cde29d27c43f3467341dbb257471b7)) - -* Feature/accommodate tox (#2) - -* Create pytest based structure; Edit the existing code to be flake8 compliant - -* Add mypy and pytest options in the pyproject.toml - -* Add setup.py and setup.cfg files with flake8 and mypy options - -* Add tox.ini with base project configurations - -* Add requirements_dev and py.typed ([`de851a1`](https://github.com/MentorMate/python-project-cli/commit/de851a19d3de95605e2ad0478a89d833150eef16)) - -* Feature/package structure (#1) - -* Create base package-based skeleton structure; Update README.md - -* Add .gitignore - -* Add simple files and tests - -* Replace setup.cfg with pyproject.toml - -* Update LICENSE; Fix wrong returt type for divide_by_three function - -* Change the test project file structure - -* Update README with info for project maintanence ([`91b5f98`](https://github.com/MentorMate/python-project-cli/commit/91b5f98405ae7d2aa4da889651d24ba429395061)) - -* Add README.md to the project ([`faa0f9a`](https://github.com/MentorMate/python-project-cli/commit/faa0f9a21139937214aec72406acb358469e0b80)) diff --git a/README.md b/README.md index 6a01722..6671c34 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A CLI tool for generating Django and FastAPI projects. ![Tests](https://github.com/MentorMate/python-project-cli/actions/workflows/tests.yaml/badge.svg) -![Deploy](https://github.com/MentorMate/python-project-cli/actions/workflows/release.yaml/badge.svg) +![Deploy](https://github.com/MentorMate/python-project-cli/actions/workflows/main_release.yaml/badge.svg) ## Overview This is a python-cli tool for interactive project setup, following best practices for **Django** and **FastAPI**. @@ -25,82 +25,6 @@ We use `pip` for our package distribution, that's why we recomend that you use v - Django - FastAPI -## Package Maintenance -**Main points** -1. In order to automate the release versioning we use `python-semantic-release`, which utilizes the [Angular Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/). That means that we need to adopt it in our commit messages (example below). -2. Make sure you `git pull` after every release, because the `pyproject.toml` and `CHANGELOG.md` will be automatically updated by `semantic-release`. -3. Include new members in `CODEOWNERS` - -### Development -- Prerequisites: - - Install `poetry`. **Make sure you have pip3/pipx installed** - ```bash - pipx install poetry - poetry install - ``` - -- pre-commit setup - Install the `pre-commit` hooks - ```bash - poetry run pre-commit install - ``` - -- git pre-push hook - Configure a pre-push hook that runs `tox` before pushing to the repository - ```bash - echo -e '#!/bin/sh\n\npoetry run tox' >> .git/hooks/pre-push - chmod ug+x .git/hooks/pre-push - ``` - -### Automatic package update -As a brief overview of the main types for angular's conventional commits: - - `BREAKING CHANGE:` **in the commit's footer** will bump to a new major version `1.0.0` -> `2.0.0` - - `feat:` will bump to a new minor version `1.0.0` -> `1.1.0` - - `fix:`, `perf:` will bump to a new patch version `1.0.0` -> `1.0.1` - - `ci:`, `docs:`, `tests:` etc. won't result in a new release, therefore won't be published in `pypi` - -Example on how to check if our commit will result in new release version, before we push: -```bash -$ git commit -m"feat: Create a new major feature" -$ poetry run semantic-release -vv version --print -... - INFO [semantic_release.version.algorithm] INFO algorithm.tags_and_versions: found 6 previous tags algorithm.py:58 -No release will be made, 0.4.0 has already been released! -... -``` - -### Manual package update - not recommended! -Prerequisites: - -- Install `build` and `twine` on root. -```bash -python3 -m pip install --upgrade build -python -m pip pinstall --upgrade twine -``` - -- Configure **pypi** token in `~/.pypirc` -``` -[testpypi] - username = __token__ - password = -``` -- Update project version in `pyproject.toml` -> `version` -```toml -[project] -name = "python_project_cli" -version = "1.0.0" #<--- new version here -``` - -- Build new .whl and .tar.gz -```bash -python3 -m build -``` - -- Upload new version to pypi -```bash -twine upload --repository testpypi dist/* -``` ## License