Skip to content

Commit

Permalink
feat : add version file
Browse files Browse the repository at this point in the history
  • Loading branch information
Senhaji-Rhazi-Hamza committed Nov 13, 2024
1 parent 6adcd8f commit f4e635f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- main
tags:
- "v*.*.*" # Optional: only run on version tags
# tags:
# - "v*.*.*" # Optional: only run on version tags
# pull_request:
# branches:
# - main
Expand Down Expand Up @@ -46,16 +46,19 @@ jobs:
needs: create-dist
strategy:
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
os: [ubuntu-latest, macos-14, macos-13, windows-latest]
# os: [macos-14]
python-version: ["3.9", "3.10"]
python-version: ["3.9"] # , "3.10"
# python-version: ["3.10"]
architecture: [x86_64, aarch64] # Explicitly define architectures
architecture: [x86_64, arm64] # Explicitly define architectures
# architecture: [aarch64] # Explicitly define architectures
exclude:
- os: windows-latest
architecture: aarch64

architecture: arm64
- os: macos-13
architecture: arm64 # macOS 13 on GitHub Actions is only x86_64 (Intel)
- os: macos-14
architecture: x86_6
steps:
- name: Check out the code
uses: actions/checkout@v4
Expand Down Expand Up @@ -124,17 +127,5 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
ls -R artifacts/
twine upload artifacts/**/*.tar.gz artifacts/**/*.whl
release:
name: Release pushed tag
runs-on: ubuntu-22.04
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
twine upload artifacts/**/*.tar.gz
twine upload artifacts/**/*.whl
3 changes: 2 additions & 1 deletion polodb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .core import PoloDB, Collection
from .version import __version__

__all__ = ["PoloDB", "Collection"]
__all__ = ["PoloDB", "Collection", "__version__"]
12 changes: 12 additions & 0 deletions polodb/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import tomli
import os


def get_version():
pyproject_path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
with open(pyproject_path, "rb") as f:
pyproject_data = tomli.load(f)
return pyproject_data["project"]["version"] # Adjust if using a different tool


__version__ = get_version()
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "polodb-python"
version = "0.1.12"
version = "0.1.13"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9"
Expand All @@ -11,7 +11,9 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]

dependencies = []
dependencies = [
"tomli>=2.0.2",
]

[build-system]
requires = ["maturin>=1,<2"]
Expand Down
6 changes: 5 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4e635f

Please sign in to comment.