Skip to content

Commit ef8f556

Browse files
authored
Merge pull request #44 from CCPBioSim/43-move-to-flat-src-structure
Update Python template to use flat package layout
2 parents d147973 + e12933b commit ef8f556

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/example_package_project-ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: example_package_YOUR_USERNAME_HERE CI
1+
name: example_package CI
22

33
on:
44
push:
@@ -25,11 +25,11 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28-
- name: Install example_package_YOUR_USERNAME_HERE and its testing dependencies
28+
- name: Install example_package and its testing dependencies
2929
run: pip install -e .[testing]
3030

3131
- name: Run test suite
32-
run: pytest --cov example_package_YOUR_USERNAME_HERE --cov-report term-missing --cov-append .
32+
run: pytest --cov example_package --cov-report term-missing --cov-append .
3333

3434
- name: Coveralls GitHub Action
3535
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Change version in repo and CITATION.cff
5252
run: |
5353
# Update Python package version
54-
sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" src/example_package_YOUR_USERNAME_HERE/__init__.py
54+
sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" src/example_package/__init__.py
5555
5656
# Update CITATION.cff version and date-released
5757
if [ -f CITATION.cff ]; then

src/example_package_YOUR_USERNAME_HERE/__init__.py renamed to example_package/__init__.py

File renamed without changes.

src/example_package_YOUR_USERNAME_HERE/example.py renamed to example_package/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# src/example_package_YOUR_USERNAME_HERE/example.py
1+
# src/example_package/example.py
22

33

44
def placeholder():

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["flit_core>=3.4,<4"]
33
build-backend = "flit_core.buildapi"
44

55
[project]
6-
name = "example_package_YOUR_USERNAME_HERE"
6+
name = "example_package"
77
dynamic = ["version"]
88

99
description = "Short description of your package"
@@ -100,5 +100,5 @@ docstring-code-format = true
100100

101101
[tool.pytest.ini_options]
102102
minversion = "9.0"
103-
addopts = "--cov=example_package_YOUR_USERNAME_HERE --cov-report=term-missing"
103+
addopts = "--cov=example_package --cov-report=term-missing"
104104
testpaths = ["tests"]

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def temp_test_dir():
1111
Provides a temporary test directory with a 'logs' subfolder.
1212
Automatically cleans up after the test.
1313
"""
14-
test_dir = tempfile.mkdtemp(prefix="example_package_YOUR_USERNAME_HERE_")
14+
test_dir = tempfile.mkdtemp(prefix="example_package_")
1515
logs_path = os.path.join(test_dir, "logs")
1616
os.makedirs(logs_path, exist_ok=True)
1717

tests/test_example_package_YOUR_USERNAME_HERE/test_example.py renamed to tests/test_example_package/test_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# tests/test_example_package_YOUR_USERNAME_HERE/test_example.py
1+
# tests/test_example_package/test_example.py
22

3-
from example_package_YOUR_USERNAME_HERE.example import placeholder
3+
from example_package.example import placeholder
44

55

66
class TestExamplePackage:
77
"""
8-
Class-based placeholder tests for example_package_YOUR_USERNAME_HERE.
8+
Class-based placeholder tests for example_package.
99
1010
- Demonstrates using a test class with pytest.
1111
- Can easily be extended with more methods for real tests.

0 commit comments

Comments
 (0)