Skip to content

Commit e426ef5

Browse files
authored
Merge branch 'main' into main
2 parents 4cb3518 + 28d1d17 commit e426ef5

8 files changed

Lines changed: 338 additions & 79 deletions

File tree

.github/workflows/check.yaml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,33 @@ jobs:
3333
pytest:
3434
name: Run pytest
3535
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
python-version:
39+
- "3.9"
40+
- "3.10"
41+
- "3.11"
42+
- "3.12"
43+
- "3.13"
44+
- "3.14"
45+
- "3.15"
46+
3647
steps:
37-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v5
3849

39-
- name: Install Python
40-
uses: actions/setup-python@v5
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v7
52+
with:
53+
python-version: ${{ matrix.python-version }}
4154

42-
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install -r requirements.txt
55+
- name: Set up Python
56+
run: uv python install
4657

47-
- name: Install openpaygo
48-
run: pip install .
58+
- name: Check Python version in uv
59+
run: uv run python --version
4960

50-
- name: Install pytest
51-
run: pip install pytest
61+
- name: Install dependencies
62+
run: uv sync
5263

5364
- name: Run pytest
54-
run: pytest
65+
run: uv run pytest

.github/workflows/ci-cd.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,13 @@ jobs:
1616
url: https://pypi.org/p/openpaygo
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

21-
- name: Setup Python
22-
uses: actions/setup-python@v4
23-
with:
24-
python-version: 3.x
25-
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install setuptools
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
3023

3124
- name: Generate package distribution
32-
run: python3 setup.py sdist
25+
run: uv build
3326

3427
- name: Publish package distributions to PyPI
3528
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 218 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,219 @@
1-
*.pyc
2-
dist
3-
openpaygo.egg-info
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[codz]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
# Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
# poetry.lock
109+
# poetry.toml
110+
111+
# pdm
112+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115+
# pdm.lock
116+
# pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# pixi
121+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122+
# pixi.lock
123+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124+
# in the .venv directory. It is recommended not to include this directory in version control.
125+
.pixi
126+
127+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128+
__pypackages__/
129+
130+
# Celery stuff
131+
celerybeat-schedule
132+
celerybeat.pid
133+
134+
# Redis
135+
*.rdb
136+
*.aof
137+
*.pid
138+
139+
# RabbitMQ
140+
mnesia/
141+
rabbitmq/
142+
rabbitmq-data/
143+
144+
# ActiveMQ
145+
activemq-data/
146+
147+
# SageMath parsed files
148+
*.sage.py
149+
150+
# Environments
151+
.env
152+
.envrc
153+
.venv
154+
env/
155+
venv/
156+
ENV/
157+
env.bak/
158+
venv.bak/
159+
160+
# Spyder project settings
161+
.spyderproject
162+
.spyproject
163+
164+
# Rope project settings
165+
.ropeproject
166+
167+
# mkdocs documentation
168+
/site
169+
170+
# mypy
171+
.mypy_cache/
172+
.dmypy.json
173+
dmypy.json
174+
175+
# Pyre type checker
176+
.pyre/
177+
178+
# pytype static type analyzer
179+
.pytype/
180+
181+
# Cython debug symbols
182+
cython_debug/
183+
184+
# PyCharm
185+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187+
# and can be added to the global gitignore or merged into this file. For a more nuclear
188+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
189+
# .idea/
190+
191+
# Abstra
192+
# Abstra is an AI-powered process automation framework.
193+
# Ignore directories containing user credentials, local state, and settings.
194+
# Learn more at https://abstra.io/docs
195+
.abstra/
196+
197+
# Visual Studio Code
198+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
201+
# you could uncomment the following to ignore the entire vscode folder
202+
# .vscode/
203+
204+
# Ruff stuff:
205+
.ruff_cache/
206+
207+
# PyPI configuration file
208+
.pypirc
209+
210+
# Marimo
211+
marimo/_static/
212+
marimo/_lsp/
213+
__marimo__/
214+
215+
# Streamlit
216+
.streamlit/secrets.toml
217+
218+
# other
4219
.DS_store
5-
__pycache__
6-
venv

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The **OpenPAYGO Python library** supports the following features:
7272
## Table of Contents
7373

7474
- [Key Features](#key-features)
75-
- [Installing the library](#installing-the-library)
75+
- [Installing the library](#installing-the-openpaygo-python-library)
7676
- [Getting Started - OpenPAYGO Token](#getting-started---openpaygo-token)
7777
- [Generating Tokens (Server Side)](#generating-tokens-server-side)
7878
- [Decoding Tokens (Device Side)](#decoding-tokens-device-side)
@@ -85,9 +85,31 @@ The **OpenPAYGO Python library** supports the following features:
8585
- Implements token generation and decoding with full support for the v2.3 of the [OpenPAYGO Token](https://github.com/EnAccess/OpenPAYGO-Token) specifications.
8686
- Implements payload authentication (verification + signing) and conversion from simple to condensed payload (and back) with full support of the v1.0-rc1 of the [OpenPAYGO Metrics](https://github.com/openpaygo/metrics) specifications.
8787

88-
## Installing the library
88+
## Installing the OpenPAYGO Python library
8989

90-
You can install the library by running `pip install openpaygo` or adding `openpaygo` in your requirements.txt file and running `pip install -r requirements.txt`.
90+
### Released version from PyPI
91+
92+
The easiest and recommended way to install the OpenPAYGO Python library is via [PyPI](https://pypi.org/project/openpaygo/).
93+
94+
You can install it directly using a package manager, for example:
95+
96+
- By adding openpaygo to your project dependencies, via:
97+
98+
```sh
99+
uv add openpaygo
100+
```
101+
102+
- Or via `pip`
103+
104+
```sh
105+
pip install openpaygo
106+
```
107+
108+
### Development setup
109+
110+
- Install [`uv`](https://docs.astral.sh/uv/)
111+
- Run `uv sync`
112+
- Run `uv run pytest`
91113

92114
## Getting Started - OpenPAYGO Token
93115

0 commit comments

Comments
 (0)