Skip to content

Commit a2485b8

Browse files
committed
chore(pdm): migrate from pipenv to pdm
1 parent d2696d2 commit a2485b8

10 files changed

+91
-104
lines changed

.github/workflows/test-lint.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
with:
2727
fetch-depth: 0
2828

29-
- name: Set up Python 3.9
29+
- name: Set up Python 3.10
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: 3.9
32+
python-version: '3.10'
3333

3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
python -m pip install --upgrade pipenv==2023.10.3 pre-commit
38-
pipenv install --dev --skip-lock
37+
python -m pip install --upgrade pdm pre-commit
38+
pdm install -G dev --frozen-lockfile
3939
4040
- uses: actions/cache@v3
4141
with:
@@ -86,14 +86,14 @@ jobs:
8686
- name: Install dependencies
8787
run: |
8888
python -m pip install --upgrade pip
89-
python -m pip install --upgrade pipenv==2023.10.3
90-
pipenv install --system --dev --skip-lock
89+
python -m pip install --upgrade pdm
90+
pdm install --global --project . -G dev --frozen-lockfile
9191
9292
- name: Test with pytest
9393
run: |
94-
pipenv run coverage run --source pygitguardian -m pytest
95-
pipenv run coverage report --fail-under=80
96-
pipenv run coverage xml
94+
pdm run coverage run --source pygitguardian -m pytest
95+
pdm run coverage report --fail-under=80
96+
pdm run coverage xml
9797
env:
9898
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
9999

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,7 @@ secrets
126126

127127
dist/
128128
.cache_ggshield
129+
130+
#pdm
131+
.pdm-python
132+
pdm.lock

.pre-commit-config.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
hooks:
1919
- id: pyright
2020
name: pyright
21-
entry: 'pipenv run pyright'
21+
entry: 'pdm run pyright'
2222
language: system
2323
types: [python]
2424
# do not pass filenames, otherwise Pyright might scan files we don't want it to scan
@@ -35,7 +35,6 @@ repos:
3535
rev: v5.10.1
3636
hooks:
3737
- id: isort
38-
args: [--settings-path, setup.cfg]
3938

4039
- repo: https://github.com/Woile/commitizen
4140
rev: v2.27.1

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ When submitting a bug report be sure that:
1717
## Dev environment
1818

1919
```bash
20-
pipenv install --dev
21-
pipenv run pre-commit install -f --hook-type commit-msg --hook-type pre-commit
20+
pdm install -G dev
21+
pdm run pre-commit install -f --hook-type commit-msg --hook-type pre-commit
2222
```
2323

2424
## Testing
@@ -48,6 +48,6 @@ Line length in the one enforced by Black: 88 characters.
4848

4949
### Changelog
5050

51-
We use [scriv](https://github.com/nedbat/scriv) to manage our changelog. It is automatically installed by `pipenv install --dev`.
51+
We use [scriv](https://github.com/nedbat/scriv) to manage our changelog. It is automatically installed by `pdm install -G dev`.
5252

5353
All user visible changes must be documented in a changelog fragment. You can create one with `scriv create`. If your pull request only contains non-visible changes (such as refactors or fixes for regressions introduced _after_ the latest release), then apply the `skip-changelog` label to the pull request.

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ all:
1111
echo " lint Run all linters"
1212

1313
test:
14-
pipenv run pytest --disable-pytest-warnings -vvv $(test)
14+
pdm run pytest --disable-pytest-warnings -vvv $(test)
1515

1616
coverage:
17-
pipenv run coverage run --source pygitguardian -m pytest --disable-pytest-warnings && pipenv run coverage report --fail-under=80
17+
pdm run coverage run --source pygitguardian -m pytest --disable-pytest-warnings && pdm run coverage report --fail-under=80
1818

1919
lint:
2020
pre-commit run --all

Pipfile

-21
This file was deleted.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ pip3 install --upgrade pygitguardian
4141
pipenv install pygitguardian
4242
```
4343

44+
**pdm**
45+
46+
```bash
47+
pdm add pygitguardian
48+
```
49+
4450
**poetry**
4551

4652
```bash

pyproject.toml

+62
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
[project]
2+
name = "pygitguardian"
3+
version = "1.14.0"
4+
description = "Python Wrapper for GitGuardian's API -- Scan security policy breaks everywhere"
5+
keywords = [
6+
"api-client devsecops secrets-detection security-tools library gitguardian",
7+
]
8+
readme = "README.md"
9+
authors = [
10+
{name = "GitGuardian", email = "[email protected]"},
11+
]
12+
maintainers = [
13+
{name = "GitGuardian", email = "[email protected]"},
14+
]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: MIT License",
19+
"Natural Language :: English",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Topic :: Security",
29+
]
30+
license = {text = "MIT"}
31+
requires-python = ">=3.8"
32+
dependencies = [
33+
"marshmallow>=3.5, <4",
34+
"requests>=2, <3",
35+
"marshmallow-dataclass >=8.5.8, <8.6.0",
36+
"typing-extensions",
37+
"setuptools>=70.1.0",
38+
]
39+
40+
[project.urls]
41+
Homepage = "https://github.com/GitGuardian/py-gitguardian"
42+
43+
[tool.pdm.dev-dependencies]
44+
dev = [
45+
"black==24.3.0",
46+
"coverage",
47+
"flake8",
48+
"flake8-isort",
49+
"isort",
50+
"pre-commit",
51+
"pytest",
52+
"vcrpy!=4.3.1,<4.4.0,>=4.3.0",
53+
"urllib3<2",
54+
"scriv[toml]",
55+
"responses<0.24.0,>=0.23.1",
56+
"pyright==1.1.367",
57+
]
58+
59+
[build-system]
60+
requires = ["pdm-backend"]
61+
build-backend = "pdm.backend"
62+
163
[tool.black]
264
target-version = ['py39']
365
line-length = 88

setup.cfg

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
ignore = E203,W503
33
inline-quotes = double
44
max-line-length = 120
5-
6-
[isort]
7-
profile = black
8-
lines_after_imports = 2
9-
10-
[metadata]
11-
description-file = README.md
5+
exclude =
6+
__pycache__
7+
.venv
8+
.git

setup.py

-60
This file was deleted.

0 commit comments

Comments
 (0)