1
0

Compare commits

..

No commits in common. "7c48537be47fda8feb983684144b584c501f19f9" and "735b34b8ab9d5cd9b741ffd9f8ce9fdd77ef17b7" have entirely different histories.

8 changed files with 27 additions and 108 deletions

View File

@ -1,33 +1,16 @@
# WARNING!
# THIS IS AN AUTOGENERATED FILE!
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
name: Package Python
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml']
paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"]
jobs:
Package-Python-And-Publish:
runs-on: ubuntu-latest
container:
image: node:21-bookworm
steps:
- name: Setting up Python ${{ env.PYTHON_VERSION }} for ${{runner.arch}} ${{runner.os}}
run: |
apt-get update
apt-get install -y python3 python3-pip
- name: Check out repository code
if: success()
uses: actions/checkout@v3
- name: Installing Python Dependencies
if: success()
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages
- name: Build
if: success()
run: python3 -m build
- name: Publish
if: success()
run: python3 -m twine upload --repository-url "https://gitfub.space/api/packages/jmaa/pypi" -u ${{ secrets.PIPY_REPO_USER }} -p ${{ secrets.PIPY_REPO_PASS }} dist/*
Package:
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.21
with:
REGISTRY_DOMAIN: gitfub.space
REGISTRY_ORGANIZATION: jmaa
secrets:
PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }}
PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }}

View File

@ -1,12 +1,8 @@
# WARNING!
# THIS IS AN AUTOGENERATED FILE!
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
name: Run Python tests (through Pytest)
on:
push:
paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml']
paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"]
jobs:
Test:

View File

@ -1,12 +1,8 @@
# WARNING!
# THIS IS AN AUTOGENERATED FILE!
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
name: Verify Python project can be installed, loaded and have version checked
on:
push:
paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md', 'ruff.toml']
paths-ignore: ["README.md", ".gitignore", "LICENSE", "ruff.toml"]
jobs:
Test:

View File

@ -1,36 +0,0 @@
<!-- WARNING! -->
<!-- THIS IS AN AUTOGENERATED FILE! -->
<!-- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN! -->
# Conventions
When contributing code to this project, you MUST follow the requirements
specified here.
## Code Conventions
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.
## Testing
When contributing test to this project, you MUST follow these principles:
- Do not use any testing libraries other than `pytest`.
- Mocking is the root of all evil. Writing your own stubs is much more
preferable.

View File

@ -1,3 +1,3 @@
Copyright (c) 2022-2025 Jon Michael Aanes
Copyright (c) 2022-2024 Jon Michael Aanes
All rights reserved.

View File

@ -1,6 +1,7 @@
<!-- WARNING! -->
<!-- THIS IS AN AUTOGENERATED FILE! -->
<!-- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN! -->
<!--- WARNING --->
<!--- THIS IS AN AUTO-GENERATED FILE --->
<!--- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN --->
# Datagraph Library
@ -10,11 +11,10 @@
Utility for working with scheme+ld and other data-graph and semantic web formats.
## Dependencies
This project requires [Python](https://www.python.org/) 3.8 or newer.
All required libraries can be installed easily using:
All requirements can be installed easily using:
```bash
pip install -r requirements.txt
@ -26,32 +26,10 @@ Full list of requirements:
- [wikidata](https://pypi.org/project/wikidata/)
## 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=datagraph test
```
## License
```
Copyright (c) 2022-2025 Jon Michael Aanes
Copyright (c) 2022-2024 Jon Michael Aanes
All rights reserved.
```

View File

@ -1 +1 @@
__version__ = '0.1.32'
__version__ = '0.1.31'

View File

@ -1,6 +1,8 @@
# WARNING!
# THIS IS AN AUTOGENERATED FILE!
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
# WARNING
#
# THIS IS AN AUTOGENERATED FILE.
#
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN.
import re
@ -19,8 +21,7 @@ Utility for working with scheme+ld and other data-graph and semantic web formats
def parse_version_file(text: str) -> str:
text = re.sub('^#.*', '', text, flags=re.MULTILINE)
match = re.match(r'^\s*__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
if match is None:
msg = 'Malformed _version.py file!'
raise Exception(msg)
@ -51,6 +52,7 @@ setup(
author='Jon Michael Aanes',
author_email='jonjmaa@gmail.com',
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
packages=[PACKAGE_NAME],
install_requires=REQUIREMENTS_MAIN,
extras_require={
'test': REQUIREMENTS_TEST,