diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e98127d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: local + hooks: + - id: testing + name: Testing + description: Running tests for the app + language: python + entry: ./bin/test.sh + +default_stages: [pre-commit, pre-push] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..18b8ed8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# Developer Guide + +This document will explain how to contribute to the edit-python.pe project. + +## How to Contribute + +1. Make sure to find an open issue on [GitHub](https://github.com/python.pe/edit-python.pe/issues). +2. Fork the [edit-python.pe](https://github.com/python.pe/edit-python.pe) repository. +3. Clone the forked repository to your local machine. +4. Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/). +5. Install dependencies: + +```bash +uv sync +``` + +6. Install pre-commit hook: + +```bash +uv run pre-commit install +``` + +7. Make your changes. +8. Cover your changes with tests. +9. Run the test coverage: + +```bash +./test/test.sh +``` + +8. Commit your changes, if the pre-commit hook fails, run `./bin/test.sh` to + know which test failed. +9. If the last step was your last commit on this issue, run this command: + +```bash +uv run ./bin/bump-version.sh +``` + +10. Push your changes to the forked repository. +11. Open a pull request on [GitHub](https://github.com/python.pe/edit-python.pe/pulls). diff --git a/pyproject.toml b/pyproject.toml index 0a8a28e..1d280c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "edit-python-pe" -version = "0.2.2" +version = "0.2.3" description = "Allows member and project profile editing onto python.pe git repository" readme = "README.md" authors = [ @@ -54,6 +54,7 @@ dev = [ "deep-translator>=1.11.4", "isort>=6.0.1", "polib>=1.2.0", + "pre-commit>=4.3.0", "pytest>=8.4.1", "pytest-cov>=6.2.1", "textual-dev==1.7.0", diff --git a/uv.lock b/uv.lock index 490918a..fd588a3 100644 --- a/uv.lock +++ b/uv.lock @@ -402,6 +402,25 @@ hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a" size = 182009 upload-time = "2024-09-04T20:44:45.309Z" +[[package]] +name = "cfgv" +version = "3.4.0" + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/11/74/539e56497d9bd1d484fd863dd69cbbfa653cd2aa27abfe35653494d85e94/cfgv-3.4.0.tar.gz" +hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560" +size = 7114 +upload-time = "2023-08-12T20:38:17.776Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/c5/55/51844dd50c4fc7a33b653bfaba4c2456f06955289ca770a5dbd5fd267374/cfgv-3.4.0-py2.py3-none-any.whl" +hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9" +size = 7249 +upload-time = "2023-08-12T20:38:16.269Z" + [[package]] name = "charset-normalizer" version = "3.4.1" @@ -1028,9 +1047,28 @@ hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec" size = 9998 upload-time = "2025-01-27T10:46:09.186Z" +[[package]] +name = "distlib" +version = "0.4.0" + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz" +hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d" +size = 614605 +upload-time = "2025-07-17T16:52:00.465Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl" +hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16" +size = 469047 +upload-time = "2025-07-17T16:51:58.613Z" + [[package]] name = "edit-python-pe" -version = "0.2.2" +version = "0.2.3" dependencies = [ { name = "babel" }, { name = "platformdirs" }, @@ -1049,6 +1087,7 @@ dev = [ { name = "deep-translator" }, { name = "isort" }, { name = "polib" }, + { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-cov" }, { name = "textual-dev" }, @@ -1071,12 +1110,32 @@ dev = [ { name = "deep-translator", specifier = ">=1.11.4" }, { name = "isort", specifier = ">=6.0.1" }, { name = "polib", specifier = ">=1.2.0" }, + { name = "pre-commit", specifier = ">=4.3.0" }, { name = "pytest", specifier = ">=8.4.1" }, { name = "pytest-cov", specifier = ">=6.2.1" }, { name = "textual-dev", specifier = "==1.7.0" }, { name = "tomli-w", specifier = ">=1.2.0" }, ] +[[package]] +name = "filelock" +version = "3.19.1" + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/40/bb/0ab3e58d22305b6f5440629d20683af28959bf793d98d11950e305c1c326/filelock-3.19.1.tar.gz" +hash = "sha256:66eda1888b0171c998b35be2bcc0f6d75c388a7ce20c3f3f37aa8e96c2dddf58" +size = 17687 +upload-time = "2025-08-14T16:56:03.016Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl" +hash = "sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d" +size = 15988 +upload-time = "2025-08-14T16:56:01.633Z" + [[package]] name = "frozenlist" version = "1.7.0" @@ -1300,6 +1359,25 @@ hash = "sha256:9a5af342e34f7e97caf8c995864c7a396418ae2859cc6fdf1b1073020d516a7e" size = 13106 upload-time = "2025-06-09T23:02:34.204Z" +[[package]] +name = "identify" +version = "2.6.13" + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/82/ca/ffbabe3635bb839aa36b3a893c91a9b0d368cb4d8073e03a12896970af82/identify-2.6.13.tar.gz" +hash = "sha256:da8d6c828e773620e13bfa86ea601c5a5310ba4bcd65edf378198b56a1f9fb32" +size = 99243 +upload-time = "2025-08-09T19:35:00.6Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/e7/ce/461b60a3ee109518c055953729bf9ed089a04db895d47e95444071dcdef2/identify-2.6.13-py2.py3-none-any.whl" +hash = "sha256:60381139b3ae39447482ecc406944190f690d4a2997f2584062089848361b33b" +size = 99153 +upload-time = "2025-08-09T19:34:59.1Z" + [[package]] name = "idna" version = "3.10" @@ -1932,6 +2010,25 @@ hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505" size = 4963 upload-time = "2025-04-22T14:54:22.983Z" +[[package]] +name = "nodeenv" +version = "1.9.1" + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz" +hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f" +size = 47437 +upload-time = "2024-06-04T18:44:11.171Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl" +hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9" +size = 22314 +upload-time = "2024-06-04T18:44:08.352Z" + [[package]] name = "packaging" version = "25.0" @@ -2027,6 +2124,32 @@ hash = "sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d" size = 20634 upload-time = "2023-02-23T17:53:59.919Z" +[[package]] +name = "pre-commit" +version = "4.3.0" +dependencies = [ + { name = "cfgv" }, + { name = "identify" }, + { name = "nodeenv" }, + { name = "pyyaml" }, + { name = "virtualenv" }, +] + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/ff/29/7cf5bbc236333876e4b41f56e06857a87937ce4bf91e117a6991a2dbb02a/pre_commit-4.3.0.tar.gz" +hash = "sha256:499fe450cc9d42e9d58e606262795ecb64dd05438943c62b66f6a8673da30b16" +size = 193792 +upload-time = "2025-08-09T18:56:14.651Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/5b/a5/987a405322d78a73b66e39e4a90e4ef156fd7141bf71df987e50717c321b/pre_commit-4.3.0-py2.py3-none-any.whl" +hash = "sha256:2b0747ad7e6e967169136edffee14c16e148a778a54e4f967921aa1ebf2308d8" +size = 220965 +upload-time = "2025-08-09T18:56:13.192Z" + [[package]] name = "propcache" version = "0.3.2" @@ -2816,6 +2939,30 @@ hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813" size = 128680 upload-time = "2025-04-10T15:23:37.377Z" +[[package]] +name = "virtualenv" +version = "20.34.0" +dependencies = [ + { name = "distlib" }, + { name = "filelock" }, + { name = "platformdirs" }, +] + +[package.source] +registry = "https://pypi.org/simple" + +[package.sdist] +url = "https://files.pythonhosted.org/packages/1c/14/37fcdba2808a6c615681cd216fecae00413c9dab44fb2e57805ecf3eaee3/virtualenv-20.34.0.tar.gz" +hash = "sha256:44815b2c9dee7ed86e387b842a84f20b93f7f417f95886ca1996a72a4138eb1a" +size = 6003808 +upload-time = "2025-08-13T14:24:07.464Z" + +[[package.wheels]] +url = "https://files.pythonhosted.org/packages/76/06/04c8e804f813cf972e3262f3f8584c232de64f0cde9f703b46cf53a45090/virtualenv-20.34.0-py3-none-any.whl" +hash = "sha256:341f5afa7eee943e4984a9207c025feedd768baff6753cd660c857ceb3e36026" +size = 5983279 +upload-time = "2025-08-13T14:24:05.111Z" + [[package]] name = "wrapt" version = "1.17.2"