Skip to content

Commit

Permalink
Chore, try pdm build. (#3)
Browse files Browse the repository at this point in the history
* Chore, try pdm build.
* ignore .venv file. Chore.
* fix build error.
* update publish process.
  • Loading branch information
Svtter authored Nov 15, 2024
1 parent 5b0d581 commit 546c184
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8 pytest . pdm
pdm install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,__pycache__,.venv
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .git,__pycache__,.venv
- name: Test with pytest
run: |
pytest
pdm run pytest
- name: Package build
run: pdm build
5 changes: 2 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ jobs:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
python -m pip install --upgrade pip pdm
- name: Build package
run: python -m build
run: pdm build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ license = {text = "MIT"}

[tool.pdm]
distribution = true
version = { source = "file", path = "src/easybuilder/__init__.py" }

[build-system]
requires = ["pdm-backend"]
Expand Down

0 comments on commit 546c184

Please sign in to comment.