Skip to content

Commit bcb23fc

Browse files
Merge pull request #89 from AlexandreSenpai/chore/pyproject-uv-migration
Updating github actions
2 parents d665597 + f7ae031 commit bcb23fc

File tree

7 files changed

+150
-53
lines changed

7 files changed

+150
-53
lines changed

.github/workflows/dev-pypi.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Development Pypi
1+
name: Development PyPI
2+
23
on:
34
push:
45
tags:
56
- "*-*"
7+
68
jobs:
79
testing-deploy:
8-
name: Pypi
10+
name: PyPI
911
runs-on: ubuntu-latest
1012
environment:
1113
name: pypi
@@ -14,39 +16,44 @@ jobs:
1416
id-token: write
1517

1618
steps:
17-
- uses: actions/checkout@v2
19+
- name: Check out repository
20+
uses: actions/checkout@v3
1821

1922
- name: Set up Python
20-
uses: actions/setup-python@master
23+
uses: actions/setup-python@v4
2124
with:
2225
python-version: 3.9
2326

24-
- name: Preparing the environment
27+
- name: Install dependencies
2528
run: |
2629
python -m pip install --upgrade pip
27-
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; else python -m pip install beautifulsoup4 requests pydantic expiringdict pytest; fi
30+
python -m pip install pip-tools
31+
pip install hatch pytest pytest-cov
32+
pip-compile pyproject.toml -o requirements-build.txt --all-extras
33+
pip install -r requirements-build.txt
2834
29-
- name: Starting Testing Suites
35+
- name: Run tests
3036
run: |
31-
ENMA_CACHING_STATE=disabled \
32-
pytest ./tests
37+
ENMA_CACHING_STATE=disabled hatch run pytest
3338
34-
- name: Upload Report to Codecov
35-
uses: codecov/codecov-action@v1
39+
- name: Upload coverage report to Codecov
40+
uses: codecov/codecov-action@v3
3641
with:
3742
token: ${{ secrets.CODECOV_TOKEN }}
38-
file: ./coverage.xml
43+
files: ./coverage.xml
3944
flags: pytest
4045

41-
- name: Building and Deploying
46+
- name: Build the package
4247
run: |
43-
python -m pip install build twine wheel setuptools_scm setuptools
44-
python -m build
48+
hatch build
4549
4650
- name: Publish a Python distribution to PyPI
47-
uses: pypa/gh-action-pypi-publish@v1.8.14
51+
uses: pypa/gh-action-pypi-publish@release/v1
4852
with:
4953
repository-url: https://test.pypi.org/legacy/
5054
user: __token__
5155
password: ${{ secrets.DEV_PYPI_API_TOKEN }}
52-
packages_dir: dist/
56+
packages-dir: dist/
57+
verify-metadata: false
58+
attestations: false
59+
verbose: true

.github/workflows/pypi.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,50 @@ jobs:
77
production-deploy:
88
name: Pypi
99
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/enma
13+
permissions:
14+
id-token: write
1015
if: "!contains(github.ref, '-')"
16+
1117
steps:
12-
- uses: actions/checkout@v2
18+
- name: Check out repository
19+
uses: actions/checkout@v3
1320

1421
- name: Set up Python
15-
uses: actions/setup-python@master
22+
uses: actions/setup-python@v4
1623
with:
1724
python-version: 3.9
1825

1926
- name: Preparing the Environment
2027
run: |
2128
python -m pip install --upgrade pip
22-
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; else python -m pip install beautifulsoup4 requests pydantic expiringdict pytest; fi
29+
python -m pip install pip-tools
30+
pip install hatch pytest pytest-cov
31+
pip-compile pyproject.toml -o requirements-build.txt --all-extras
32+
pip install -r requirements-build.txt
2333
2434
- name: Starting Testing Suites
2535
run: |
2636
ENMA_CACHING_STATE=disabled \
27-
pytest ./tests
37+
hatch run pytest ./tests
2838
2939
- name: Upload Report to Codecov
30-
uses: codecov/codecov-action@v1
40+
uses: codecov/codecov-action@v3
3141
with:
3242
token: ${{ secrets.CODECOV_TOKEN }}
3343
file: ./coverage.xml
3444
flags: pytest
3545

3646
- name: Building and Deploying
3747
run: |
38-
python -m pip install build twine wheel setuptools_scm setuptools
39-
python -m build
48+
hatch build
4049
4150
- name: Publish a Python distribution to PyPI
4251
uses: pypa/gh-action-pypi-publish@release/v1
4352
with:
4453
user: __token__
4554
password: ${{ secrets.PYPI_API_TOKEN }}
46-
packages_dir: dist/
55+
packages-dir: dist/
56+
verify-metadata: false

.github/workflows/testing.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@ jobs:
2424
- name: Preparing the environment
2525
run: |
2626
python -m pip install --upgrade pip
27-
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; else python -m pip install beautifulsoup4 requests pydantic expiringdict pytest pytest-cov; fi
27+
python -m pip install pip-tools
28+
pip install pytest pytest-cov
29+
pip-compile pyproject.toml -o requirements-build.txt --all-extras
30+
pip install -r requirements-build.txt
2831
2932
- name: Starting Testing Suites
3033
run: |
3134
ENMA_CACHING_STATE=disabled \
3235
pytest --cov=. --cov-report=xml ./tests
3336
3437
- name: Upload Report to Codecov
35-
uses: codecov/codecov-action@v1
38+
uses: codecov/codecov-action@v3
3639
with:
3740
token: ${{ secrets.CODECOV_TOKEN }}
3841
file: ./coverage.xml

enma/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
__version_tuple__: VERSION_TUPLE
1313
version_tuple: VERSION_TUPLE
1414

15-
__version__ = version = '2.4.5.dev0+gc9b40af.d20250111'
16-
__version_tuple__ = version_tuple = (2, 4, 5, 'dev0', 'gc9b40af.d20250111')
15+
__version__ = version = '2.4.4'
16+
__version_tuple__ = version_tuple = (2, 4, 4)

pyproject.toml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ classifiers = [
1313
]
1414
dynamic = ["version"]
1515

16-
[project.urls]
17-
"Github" = "https://github.com/AlexandreSenpai/Enma"
18-
19-
[project.optional-dependencies]
20-
google_drive = [
21-
"google-api-python-client>=2.0.0",
22-
"google-auth-httplib2>=0.1.0",
23-
"google-auth-oauthlib>=0.4.0",
24-
]
25-
2616
dependencies = [
2717
"beautifulsoup4==4.12.3",
2818
"expiringdict==1.2.2",
@@ -36,6 +26,17 @@ dev = [
3626
"pytest==8.3.2",
3727
]
3828

29+
[project.optional-dependencies]
30+
google_drive = [
31+
"google-api-python-client>=2.0.0",
32+
"google-auth-httplib2>=0.1.0",
33+
"google-auth-oauthlib>=0.4.0",
34+
]
35+
36+
[project.urls]
37+
"Github" = "https://github.com/AlexandreSenpai/Enma"
38+
"Documentation" = "https://docs.minorin.io/enma"
39+
3940
[build-system]
4041
requires = ["hatchling", "hatch-vcs"]
4142
build-backend = "hatchling.build"
@@ -60,6 +61,9 @@ source = "vcs"
6061
[tool.hatch.build.hooks.vcs]
6162
version-file = "enma/_version.py"
6263

64+
[tool.hatch.version.raw-options]
65+
local_scheme = "no-local-version"
66+
6367
[tool.coverage.run]
6468
omit = [
6569
"*/interfaces/*",

requirements.txt

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,82 @@
1-
requests==2.32.3
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --all-extras --output-file=requirements.txt pyproject.toml
6+
#
7+
annotated-types==0.7.0
8+
# via pydantic
29
beautifulsoup4==4.12.3
3-
pydantic==2.8.2
4-
pytest==8.3.2
10+
# via enma (pyproject.toml)
11+
cachetools==5.5.0
12+
# via google-auth
13+
certifi==2024.12.14
14+
# via requests
15+
charset-normalizer==3.4.1
16+
# via requests
517
expiringdict==1.2.2
6-
pytest-cov==4.1.0
7-
google-api-python-client>=2.0.0
8-
google-auth-httplib2>=0.1.0
9-
google-auth-oauthlib>=0.4.0
18+
# via enma (pyproject.toml)
19+
google-api-core==2.24.0
20+
# via google-api-python-client
21+
google-api-python-client==2.158.0
22+
# via enma (pyproject.toml)
23+
google-auth==2.37.0
24+
# via
25+
# google-api-core
26+
# google-api-python-client
27+
# google-auth-httplib2
28+
# google-auth-oauthlib
29+
google-auth-httplib2==0.2.0
30+
# via
31+
# enma (pyproject.toml)
32+
# google-api-python-client
33+
google-auth-oauthlib==1.2.1
34+
# via enma (pyproject.toml)
35+
googleapis-common-protos==1.66.0
36+
# via google-api-core
37+
httplib2==0.22.0
38+
# via
39+
# google-api-python-client
40+
# google-auth-httplib2
41+
idna==3.10
42+
# via requests
43+
oauthlib==3.2.2
44+
# via requests-oauthlib
45+
proto-plus==1.25.0
46+
# via google-api-core
47+
protobuf==5.29.3
48+
# via
49+
# google-api-core
50+
# googleapis-common-protos
51+
# proto-plus
52+
pyasn1==0.6.1
53+
# via
54+
# pyasn1-modules
55+
# rsa
56+
pyasn1-modules==0.4.1
57+
# via google-auth
58+
pydantic==2.8.2
59+
# via enma (pyproject.toml)
60+
pydantic-core==2.20.1
61+
# via pydantic
62+
pyparsing==3.2.1
63+
# via httplib2
64+
requests==2.32.3
65+
# via
66+
# enma (pyproject.toml)
67+
# google-api-core
68+
# requests-oauthlib
69+
requests-oauthlib==2.0.0
70+
# via google-auth-oauthlib
71+
rsa==4.9
72+
# via google-auth
73+
soupsieve==2.6
74+
# via beautifulsoup4
75+
typing-extensions==4.12.2
76+
# via
77+
# pydantic
78+
# pydantic-core
79+
uritemplate==4.1.1
80+
# via google-api-python-client
81+
urllib3==2.3.0
82+
# via requests

uv.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)