Skip to content
Merged

Dev #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Build dist
run: |
. ./venv/bin/activate
python -m build
python -m build --sdist --wheel --no-isolation --outdir dist/ .
twine check dist/*

- name: Commit updated pyproject.toml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Test Unittests with pytest
run: |
. ./venv/bin/activate
python run_pytests.py --tests_folder=tests --N_RANDOM_TESTS_PER_CASE=3 --no-run_slow --cov-report=xml:tests/.tmp/coverage.xml
pytest tests -n=auto --cov=src --cov-report="xml:tests/.tmp/coverage.xml" --cov-report=term-missing --durations=10

- name: Code Coverage
uses: orgoro/coverage@v3.2
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Test Build
run: |
. ./venv/bin/activate
python -m build
python -m build --sdist --wheel --no-isolation --outdir dist/ .
twine check dist/*

Run-tests-on-Windows:
Expand All @@ -91,4 +91,4 @@ jobs:
- name: Test Unittests with pytest
run: |
. ./venv/Scripts/activate
python run_pytests.py --tests_folder=tests --N_RANDOM_TESTS_PER_CASE=1 --no-run_slow
pytest tests -n=auto
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
![Tests Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/tests.yml/badge.svg)
![Dist Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/build_dist.yml/badge.svg)
![Doc Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/docs.yml/badge.svg)
![Code coverage](https://raw.githubusercontent.com/JeremieGince/PythonProject-Template/coverage-badge/coverage.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)


# Description

Expand Down
6 changes: 3 additions & 3 deletions change_project_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def update_pyproject_toml(args):
print(f"Setting author to {new_author}")
content = re.sub(r'authors = \[.*?]', new_author, content)
if args.package_name is not None:
new_version = "version = {attr = \"%s.__version__\"}" % args.package_name
content = re.sub(r'version = {attr = ".*?"}', new_version, content)
content = re.sub(
r'packages = \[{include = ".*?", from="src"\}]',
f'packages = [{{include = "{args.package_name}", from="src"}}]',
Expand All @@ -93,6 +91,8 @@ def update_init_file(args):
content = re.sub(r'__email__ = "(.*?)"', f'__email__ = "{args.email}"', content)
if args.url is not None:
content = re.sub(r'__url__ = "(.*?)"', f'__url__ = "{args.url}"', content)
if args.pakage_name is not None:
content = re.sub(r'__package__ = "(.*?)"', f'__package__ = "{args.package_name}"', content)
with open(init_file, "w") as f:
f.write(content)
return 0
Expand Down Expand Up @@ -144,7 +144,7 @@ def update_readme_md(args):
with open("README.md", "r") as f:
content = f.read()
if args.project_name is not None:
content = re.sub(r'# (.*?)', f'# {args.project_name}\n', content)
content = re.sub(r'# PythonProject-Template', f'# {args.project_name}\n', content)
with open("README.md", "w") as f:
f.write(content)
return 0
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ requires-python = ">=3.10,<4"
dependencies = [
"numpy (>=1.23,<3.0.0)",
"setuptools>=65.5.1",
"pythonbasictools>=0.0.1a11",
"pythonbasictools>=0.0.3",
"psutil>=5.9.6",
"importlib-metadata (>=8.7.0,<9.0.0)"
]
Expand Down
86 changes: 0 additions & 86 deletions run_pytests.py

This file was deleted.