From 98ed37d913cacfb3ad8bfe954620b957fcaadd6d Mon Sep 17 00:00:00 2001 From: takunomi-build-bot Date: Wed, 9 Apr 2025 21:42:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Repository=20layout=20updated=20?= =?UTF-8?q?to=20latest=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit was automatically generated by a script: https://gitfub.space/Jmaa/repo-manager --- .gitea/workflows/python-package.yml | 2 +- .gitea/workflows/python-test.yml | 2 +- .gitea/workflows/python-version-check.yml | 2 +- CONVENTIONS.md | 17 ++++++++ LICENSE | 2 +- README.md | 47 +++++++++++++++-------- setup.py | 21 +++------- 7 files changed, 58 insertions(+), 35 deletions(-) create mode 100644 CONVENTIONS.md diff --git a/.gitea/workflows/python-package.yml b/.gitea/workflows/python-package.yml index 09275ea..2ee342a 100644 --- a/.gitea/workflows/python-package.yml +++ b/.gitea/workflows/python-package.yml @@ -3,7 +3,7 @@ on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' - paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"] + paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml'] jobs: Package: diff --git a/.gitea/workflows/python-test.yml b/.gitea/workflows/python-test.yml index 53c4f50..658e0c5 100644 --- a/.gitea/workflows/python-test.yml +++ b/.gitea/workflows/python-test.yml @@ -2,7 +2,7 @@ name: Run Python tests (through Pytest) on: push: - paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"] + paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml'] jobs: Test: diff --git a/.gitea/workflows/python-version-check.yml b/.gitea/workflows/python-version-check.yml index e25ebe3..636e7c4 100644 --- a/.gitea/workflows/python-version-check.yml +++ b/.gitea/workflows/python-version-check.yml @@ -2,7 +2,7 @@ name: Verify Python project can be installed, loaded and have version checked on: push: - paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"] + paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml'] jobs: Test: diff --git a/CONVENTIONS.md b/CONVENTIONS.md new file mode 100644 index 0000000..60cd60c --- /dev/null +++ b/CONVENTIONS.md @@ -0,0 +1,17 @@ +When contributing code to this project, you MUST follow these principles: + +- Code should be easy to read and understand. +- Keep the code as simple as possible. Avoid unnecessary complexity. +- Use meaningful names for variables, functions, etc. Names should reveal intent. +- Functions should be small and do one thing well. They should not exceed a few lines. +- Function names should describe the action being performed. +- Only use comments when necessary, as they can become outdated. Instead, strive to make the code self-explanatory. +- When comments are used, they should add useful information that is not readily apparent from the code itself. +- Properly handle errors and exceptions to ensure the software's robustness. +- Use exceptions rather than error codes for handling errors. +- Consider security implications of the code. Implement security best practices to protect against vulnerabilities and attacks. +- Documentation should document semantics, not syntax. +- Prefer importing modules, not individual items from modules. +- Do not use f-strings in logging statements. +- Loop variables and walrus-expression-variables should be deleted when + unneeded to keep scope clean, and to avoid accidental use. diff --git a/LICENSE b/LICENSE index e7dc39c..b4c4f98 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023-2024 Jon Michael Aanes +Copyright (c) 2023-2025 Jon Michael Aanes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2b4db4f..9f831ac 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ ![Test program/library](https://gitfub.space/Jmaa/pbcabi/actions/workflows/python-test.yml/badge.svg) -Utility library for parsing and processing the Partisia Blockchain ABI Format. +Unofficial utility library for parsing and processing the Partisia Blockchain ABI Format. -The format is specified here: [Partisia Blockchain's ABI format](https://partisiablockchain.gitlab.io/documentation/smart-contracts/smart-contract-binary-formats.html).. +The format is specified here: [Partisia Blockchain's ABI format](https://partisiablockchain.gitlab.io/documentation/smart-contracts/smart-contract-binary-formats.html). + +This library is not officially associated with Partisia Blockchain nor Partisia +Group ApS. ## Example usage @@ -41,21 +44,11 @@ print(token_state['balances'][my_address]) > 213112 ``` -## Legalese - -This project is licensed under MIT Licence, see `LICENSE` for full text. - -This project is not associated with, nor supported by any of: - -- Partisia Applications A/S -- Partisia Infrastructure A/S -- Partisia Blockchain Foundation - -Use at own risk. - ## Dependencies -All requirements can be installed easily using: +This project requires [Python](https://www.python.org/) 3.8 or newer. + +All required libraries can be installed easily using: ```bash pip install -r requirements.txt @@ -66,12 +59,34 @@ Full list of requirements: - [frozendict](https://pypi.org/project/frozendict/) +## Contributing + +Feel free to submit pull requests. Please follow the [Code Conventions](CONVENTIONS.md) when doing so. + + +### Testing + +Testing requires the [pytest](https://docs.pytest.org/en/stable/) library. + +Run tests with the following command: + +```sh +pytest test +``` + +Test coverage can be run using the [`pytest-cov`](https://pypi.org/project/pytest-cov/) extension: + +```sh +pytest --cov=pbcabi test +``` + + ## License ``` MIT License -Copyright (c) 2023-2024 Jon Michael Aanes +Copyright (c) 2023-2025 Jon Michael Aanes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.py b/setup.py index bc6cde2..760cb11 100644 --- a/setup.py +++ b/setup.py @@ -13,9 +13,12 @@ PACKAGE_NAME = 'pbcabi' PACKAGE_DESCRIPTION = """ # Partisia Blockchain ABI client. -Utility library for parsing and processing the Partisia Blockchain ABI Format. +Unofficial utility library for parsing and processing the Partisia Blockchain ABI Format. -The format is specified here: [Partisia Blockchain's ABI format](https://partisiablockchain.gitlab.io/documentation/smart-contracts/smart-contract-binary-formats.html).. +The format is specified here: [Partisia Blockchain's ABI format](https://partisiablockchain.gitlab.io/documentation/smart-contracts/smart-contract-binary-formats.html). + +This library is not officially associated with Partisia Blockchain nor Partisia +Group ApS. ## Example usage @@ -45,22 +48,10 @@ print(token_state['name']) print(token_state['balances'][my_address]) > 213112 ``` - -## Legalese - -This project is licensed under MIT Licence, see `LICENSE` for full text. - -This project is not associated with, nor supported by any of: - -- Partisia Applications A/S -- Partisia Infrastructure A/S -- Partisia Blockchain Foundation - -Use at own risk. """.strip() PACKAGE_DESCRIPTION_SHORT = """ -Utility library for parsing and processing the Partisia Blockchain ABI Format.""".strip() +Unofficial utility library for parsing and processing the Partisia Blockchain ABI Format.""".strip() def parse_version_file(text: str) -> str: