Skip to content

Commit 9a428dc

Browse files
authored
Follow Python standard packaging guidelines (#846)
* Follow Python standard packaging guidelines * Update pipeline.yml to use 'src' directory * Update pipeline.yml * fix tests * Specify source for coverage * link src as default source * name package just executorlib * skip version file * clean up * Update path for git assume-unchanged command * Configure Hatch build settings for executorlib * Update pyreverse command to use src directory * Fix pyreverse path in GitHub Actions workflow
1 parent 32943d6 commit 9a428dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+15
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
cp .ci_support/environment-old.yml environment.yml
3333
python .ci_support/release.py; cat pyproject.toml
34-
git update-index --assume-unchanged pyproject.toml executorlib/_version.py
34+
git update-index --assume-unchanged pyproject.toml src/executorlib/_version.py
3535
hatchling build -t sdist -t wheel
3636
- name: Publish distribution 📦 to PyPI
3737
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/pipeline.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: psf/black@stable
1414
with:
1515
options: "--check --diff"
16-
src: ./${{ github.event.repository.name }}
16+
src: ./src/${{ github.event.repository.name }}
1717

1818
black_fix: # in most cases pre-commit is faster
1919
needs: [black]
@@ -29,7 +29,7 @@ jobs:
2929
uses: psf/black@stable
3030
with:
3131
options: ""
32-
src: "./${{ github.event.repository.name }}"
32+
src: "./src/${{ github.event.repository.name }}"
3333
- name: commit
3434
run: |
3535
git config --local user.email "[email protected]"
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install mypy
5656
run: pip install mypy
5757
- name: Test
58-
run: mypy --ignore-missing-imports ${{ github.event.repository.name }}
58+
run: mypy --ignore-missing-imports src/${{ github.event.repository.name }}
5959

6060
minimal:
6161
needs: [black]
@@ -451,7 +451,7 @@ jobs:
451451
timeout-minutes: 10
452452
run: |
453453
conda install -y pylint graphviz
454-
pyreverse -o png -p ./${{ github.event.repository.name }} ./${{ github.event.repository.name }}
454+
pyreverse -o png -p ./src/${{ github.event.repository.name }} ./src/${{ github.event.repository.name }}
455455
zip -m uml.zip *.png
456456
- uses: actions/upload-artifact@v4
457457
with:

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,26 @@ ignore = [
103103

104104
[tool.hatch.build]
105105
include = [
106-
"executorlib"
106+
"src/executorlib"
107107
]
108108

109109
[tool.hatch.build.hooks.vcs]
110-
version-file = "executorlib/_version.py"
110+
version-file = "src/executorlib/_version.py"
111111

112112
[tool.hatch.build.targets.sdist]
113113
include = [
114-
"executorlib"
114+
"src/executorlib"
115115
]
116116

117117
[tool.hatch.build.targets.wheel]
118118
packages = [
119-
"executorlib"
119+
"src/executorlib"
120120
]
121121

122122
[tool.hatch.version]
123123
source = "vcs"
124-
path = "executorlib/_version.py"
124+
path = "src/executorlib/_version.py"
125125

126126
[tool.coverage.run]
127-
omit = ["executorlib/_version.py", "tests/*"]
127+
source = ["executorlib"]
128128
command_line = "-m unittest discover tests"
File renamed without changes.

0 commit comments

Comments
 (0)