Skip to content

Commit 9dd39b4

Browse files
authored
chore:use pdm replace uv (#13)
1 parent 5d083a9 commit 9dd39b4

File tree

11 files changed

+2681
-2580
lines changed

11 files changed

+2681
-2580
lines changed

.github/workflows/publish-docs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ jobs:
1919
- name: Checkout Github Repository
2020
uses: actions/checkout@v4
2121

22-
- name: Install uv
23-
uses: astral-sh/setup-uv@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
2424
with:
25-
enable-cache: true
25+
python-version: ${{ matrix.python-version }}
2626

27-
- name: Set up Python
28-
run: uv python install ${{ matrix.python-version }}
27+
- name: Install PDM
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install pdm
31+
pdm venv create
2932
3033
- name: Install dependencies
31-
run: uv sync --extra doc
34+
run: pdm sync -G doc
3235

3336
- name: Run build-sphinx
3437
run: make doc

.github/workflows/run-tests.yml

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ jobs:
1919
- name: Checkout Github Repository
2020
uses: actions/checkout@v4
2121

22-
- name: Install uv
23-
uses: astral-sh/setup-uv@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
2424
with:
25-
enable-cache: true
25+
python-version: ${{ matrix.python-version }}
2626

27-
- name: Set up Python
28-
run: uv python install ${{ matrix.python-version }}
27+
- name: Install PDM
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install pdm
31+
pdm venv create
2932
3033
- name: Install dependencies
31-
run: uv sync --all-extras
34+
run: pdm sync -G dev --venv
3235

3336
- name: Run unit-test
3437
run: make test
@@ -54,16 +57,19 @@ jobs:
5457
- name: Checkout Github Repository
5558
uses: actions/checkout@v4
5659

57-
- name: Install uv
58-
uses: astral-sh/setup-uv@v4
60+
- name: Set up Python
61+
uses: actions/setup-python@v5
5962
with:
60-
enable-cache: true
63+
python-version: ${{ matrix.python-version }}
6164

62-
- name: Set up Python
63-
run: uv python install ${{ matrix.python-version }}
65+
- name: Install PDM
66+
run: |
67+
python -m pip install --upgrade pip
68+
python -m pip install pdm
69+
pdm venv create
6470
6571
- name: Install dependencies
66-
run: uv sync --all-extras
72+
run: pdm sync -G dev --venv
6773

6874
- name: Run style-check
6975
run: make style_check
@@ -80,16 +86,19 @@ jobs:
8086
- name: Checkout Github Repository
8187
uses: actions/checkout@v4
8288

83-
- name: Install uv
84-
uses: astral-sh/setup-uv@v4
89+
- name: Set up Python
90+
uses: actions/setup-python@v5
8591
with:
86-
enable-cache: true
92+
python-version: ${{ matrix.python-version }}
8793

88-
- name: Set up Python
89-
run: uv python install ${{ matrix.python-version }}
94+
- name: Install PDM
95+
run: |
96+
python -m pip install --upgrade pip
97+
python -m pip install pdm
98+
pdm venv create
9099
91100
- name: Install dependencies
92-
run: uv sync --all-extras
101+
run: pdm sync -G dev --venv
93102

94103
- name: Run static-check
95104
run: make static_check
@@ -106,16 +115,19 @@ jobs:
106115
- name: Checkout Github Repository
107116
uses: actions/checkout@v4
108117

109-
- name: Install uv
110-
uses: astral-sh/setup-uv@v4
118+
- name: Set up Python
119+
uses: actions/setup-python@v5
111120
with:
112-
enable-cache: true
121+
python-version: ${{ matrix.python-version }}
113122

114-
- name: Set up Python
115-
run: uv python install ${{ matrix.python-version }}
123+
- name: Install PDM
124+
run: |
125+
python -m pip install --upgrade pip
126+
python -m pip install pdm
127+
pdm venv create
116128
117129
- name: Install dependencies
118-
run: uv sync --all-extras
130+
run: pdm sync -G dev --venv
119131

120132
- name: Run bandit-check
121133
continue-on-error: true
@@ -144,16 +156,19 @@ jobs:
144156
- name: Checkout Github Repository
145157
uses: actions/checkout@v4
146158

147-
- name: Install uv
148-
uses: astral-sh/setup-uv@v4
159+
- name: Set up Python
160+
uses: actions/setup-python@v5
149161
with:
150-
enable-cache: true
162+
python-version: ${{ matrix.python-version }}
151163

152-
- name: Set up Python
153-
run: uv python install ${{ matrix.python-version }}
164+
- name: Install PDM
165+
run: |
166+
python -m pip install --upgrade pip
167+
python -m pip install pdm
168+
pdm venv create
154169
155170
- name: Install dependencies
156-
run: uv sync --all-extras
171+
run: pdm sync -G dev --venv
157172

158173
- name: Run pyre-check
159174
continue-on-error: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ venv
2222
.venv
2323
.tests
2424
.python-version
25+
.devcontainer
26+
.pdm-python

Makefile

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,41 @@
11
PACKAGE := megstore
2-
VERSION := $(shell cat ${PACKAGE}/version.py | sed -n -E 's/.*=//; s/ //g; s/"//g; p')
2+
VERSION := $(shell cat ${PACKAGE}/__version__.py | sed -n -E 's/.*=//; s/ //g; s/"//g; p')
33

44
test:
5-
uv run pytest \
5+
pdm run pytest \
66
--cov=${PACKAGE} --cov-config=pyproject.toml --cov-report=html:html_cov/ --cov-report=term-missing --cov-report=xml --no-cov-on-fail \
77
--durations=10 \
88
tests/
99

1010
format:
11-
uv run ruff check --fix ${PACKAGE} tests scripts pyproject.toml
12-
uv run ruff format ${PACKAGE} tests scripts pyproject.toml
11+
pdm run ruff check --fix ${PACKAGE} tests scripts pyproject.toml
12+
pdm run ruff format ${PACKAGE} tests scripts pyproject.toml
1313

1414
style_check:
15-
uv run ruff check ${PACKAGE} tests scripts pyproject.toml
16-
uv run ruff format --check ${PACKAGE} tests scripts pyproject.toml
15+
pdm run ruff check ${PACKAGE} tests scripts pyproject.toml
16+
pdm run ruff format --check ${PACKAGE} tests scripts pyproject.toml
1717

1818
static_check:
1919
make pytype_check
2020

2121
pytype_check:
22-
uv run pytype
22+
pdm run pytype
2323

2424
bandit_check:
25-
uv run bandit --quiet --format=sarif --recursive megstore/ > bandit-sarif.json || echo
25+
pdm run bandit --quiet --format=sarif --recursive ${PACKAGE}/ > bandit-sarif.json || echo
2626

2727
pyre_check:
28-
uv run pyre --version=none --output=json check > pyre-errors.json || echo
28+
pdm run pyre --version=none --output=json check > pyre-errors.json || echo
2929
cat pyre-errors.json | ./scripts/convert_results_to_sarif.py > pyre-sarif.json
3030

31-
mut:
32-
@echo Mutation testing...
33-
uv run mutmut run || echo
34-
uv run mutmut show all
35-
uv run mutmut junitxml > mutmut.xml
36-
3731
doc:
38-
PYTHONPATH=. uv run sphinx-build --fresh-env docs html_doc
32+
PYTHONPATH=. pdm run sphinx-build --fresh-env docs html_doc
3933

4034
release:
4135
git tag ${VERSION}
4236
git push origin ${VERSION}
4337

4438
rm -rf build dist
45-
uv build --wheel
39+
pdm build --no-sdist
4640

47-
uv run twine upload dist/${PACKAGE}-${VERSION}-py3-none-any.whl --username='${PYPI_USERNAME}' --password='${PYPI_PASSWORD}'
41+
pdm run twine upload dist/${PACKAGE}-${VERSION}-py3-none-any.whl --username='${PYPI_USERNAME}' --password='${PYPI_PASSWORD}'

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This file is kept for Read the Docs compatibility
2-
# For local development, use: uv sync --extra doc
2+
# For local development, use: pdm install -G doc
33
megstore[doc]

megstore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from megstore.__version__ import __version__ # noqa: F401
12
from megstore.indexed import (
23
IndexedJsonlineReader,
34
IndexedJsonlineWriter,
@@ -9,7 +10,6 @@
910
indexed_msgpack_open,
1011
indexed_txt_open,
1112
)
12-
from megstore.version import VERSION as __version__ # noqa: F401
1313

1414
__all__ = [
1515
"IndexedJsonlineReader",

megstore/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.1"

megstore/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)