Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
Setup PDM (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
teobucci authored Mar 20, 2024
1 parent 21ee36c commit cee2b6b
Show file tree
Hide file tree
Showing 7 changed files with 3,217 additions and 14 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y pandoc
- name: Setup PDM
uses: pdm-project/setup-pdm@v4

- name: Install dependencies
run: |
pip install ".[docs]"
python -m ipykernel install --user --name python3
pdm install -G docs
pdm run python -m ipykernel install --user --name python3
- name: Sphinx build
run: |
sphinx-build docs/source docs/build
pdm run sphinx-build docs/source docs/build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release_pypi_github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ jobs:
with:
python-version: "3.x"

- name: Setup PDM
uses: pdm-project/setup-pdm@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine bumpver build
pdm install
- name: Build source and wheel distributions
run: |
python -m build
twine check dist/*
pdm run python -m build
pdm run twine check dist/*
- name: Publish distribution to PyPI
uses: pypa/[email protected]
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2

- name: Checkout source
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup PDM
uses: pdm-project/setup-pdm@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
pdm install -G test
- name: Run pytest
run: |
pytest
pdm run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,4 @@ pyrightconfig.json

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

.pdm-python
Expand Down
3,184 changes: 3,184 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -32,13 +32,14 @@ dependencies = [
"seaborn",
"scikit-learn",
]
requires-python = ">=3.9"

[project.urls]
Homepage = "https://github.com/teobucci/tefs"
Documentation = "https://github.com/teobucci/tefs"
Repository = "https://github.com/teobucci/tefs"

[project.optional-dependencies]
[tool.pdm.dev-dependencies]
docs = [
"sphinx",
"sphinx-rtd-theme",
Expand All @@ -49,13 +50,16 @@ docs = [
"jupyterlab",
"nbconvert",
]
dev = [
test = [
"pytest",
"pytest-cov",
]
build = [
"setuptools",
"wheel",
"twine",
"build",
"bumpver",
]

[tool.bumpver]
Expand All @@ -69,3 +73,6 @@ push = true
[tool.bumpver.file_patterns]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"src/tefs/__init__.py" = ["{version}"]

[tool.pdm]
distribution = true
Empty file added tests/__init__.py
Empty file.

0 comments on commit cee2b6b

Please sign in to comment.