diff --git a/.copier-answers.yaml b/.copier-answers.yaml index dafbbb0..10034c6 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 3a223c6 +_commit: 9a153d8 _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: python diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea7..b1c6256 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,38 +1,29 @@ --- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' +name: Bug Report +about: Report a bug to help us improve +title: '[BUG] ' +labels: 'type: bug' assignees: '' - --- -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +**Description** +A clear and concise description of the bug. -**Expected behavior** -A clear and concise description of what you expected to happen. +**Steps to Reproduce** +1. +2. +3. -**Screenshots** -If applicable, add screenshots to help explain your problem. +**Expected Behavior** +What you expected to happen. -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] +**Actual Behavior** +What actually happened. Include full error messages or tracebacks if available. -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] +**Environment** +- OS: [e.g. Ubuntu 22.04, macOS 14.0, Windows 11] +- Python version: [e.g. 3.11.5] (`python --version`) +- Package version: (`pip show physics-workload | grep Version`) -**Additional context** -Add any other context about the problem here. +**Additional Context** +Add any other relevant context, logs, or screenshots. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7..c3e422e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,19 @@ --- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' +name: Feature Request +about: Suggest a new feature or improvement +title: '[FEATURE] ' +labels: 'type: enhancement' assignees: '' - --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +**Problem Statement** +A clear description of the problem this feature would solve. Ex. "I'm always frustrated when [...]" -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +**Proposed Solution** +A clear description of the desired behavior or feature. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Alternatives Considered** +Any alternative solutions or workarounds you've considered. -**Additional context** -Add any other context or screenshots about the feature request here. +**Additional Context** +Add any other context, mockups, or examples. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..ca52f7e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,16 @@ +--- +name: Question +about: Ask a question about usage or behavior +title: '[QUESTION] ' +labels: 'tag: question' +assignees: '' +--- + +**Question** +A clear and concise description of your question. + +**Context** +What are you trying to accomplish? Include relevant code snippets, configuration, or links to documentation you've already consulted. + +**Environment** +If relevant, include your environment details (OS, language versions, package version). diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..35c3de1 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +## Description + +Brief description of the changes in this PR. + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update +- [ ] Refactor / code cleanup +- [ ] CI / build configuration +- [ ] Other (describe below) + +## Checklist + +- [ ] Linting passes (`make lint`) +- [ ] Tests pass (`make test`) +- [ ] New tests added for new functionality +- [ ] Documentation updated (if applicable) +- [ ] Changelog / version bump (if applicable) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 83b0aab..5c3eca9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,7 +33,7 @@ jobs: python-version: ["3.12"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions-ext/python/setup@main with: @@ -53,6 +53,7 @@ jobs: - name: Build run: make build +<<<<<<< before updating # - name: Test # run: make coverage # @@ -72,3 +73,40 @@ jobs: # uses: codecov/codecov-action@v5 # with: # token: ${{ secrets.CODECOV_TOKEN }} +======= + - name: Test + run: make coverage + + - name: Upload test results (Python) + uses: actions/upload-artifact@v7 + with: + name: test-results-${{ matrix.os }}-${{ matrix.python-version }} + path: junit.xml + if: ${{ always() }} + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: '**/junit.xml' + + - name: Upload coverage + uses: codecov/codecov-action@v6 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Make dist + run: make dist + + - uses: actions-ext/python/test-wheel@main + with: + module: physics_workload + + - uses: actions-ext/python/test-sdist@main + with: + module: physics_workload + + - uses: actions/upload-artifact@v7 + with: + name: dist-${{matrix.os}} + path: dist +>>>>>>> after updating diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e7707ef..c47e900 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,24 +1,57 @@ name: Publish Docs on: - push: - branches: - - main + workflow_run: + workflows: ["Build Status"] + branches: [main] + types: [completed] workflow_dispatch: + permissions: + actions: read contents: write + jobs: docs: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions-ext/python/setup@main +<<<<<<< before updating - run: | sudo apt-get update sudo apt-get install -y libldap2-dev libssl-dev libsasl2-dev - run: uv pip install .[develop] - run: uv pip install yardang +======= + + - name: Download dist from build + uses: actions/download-artifact@v8 + with: + pattern: dist-ubuntu-latest* + merge-multiple: true + path: dist + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + if: github.event_name == 'workflow_run' + + - name: Install from wheel + run: | + uv pip install dist/*.whl + uv pip install yardang + if: github.event_name == 'workflow_run' + + - name: Install from source (manual trigger) + run: | + uv pip install .[develop] + uv pip install yardang + if: github.event_name == 'workflow_dispatch' + +>>>>>>> after updating - run: yardang build + - uses: peaceiris/actions-gh-pages@v4 with: publish_branch: gh-pages diff --git a/.gitignore b/.gitignore index e5a9a38..da60baa 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ __pycache__/ *.exp *.lib +# Rust +target + # Distribution / packaging .Python build/ @@ -55,26 +58,12 @@ junit.xml .hypothesis/ .pytest_cache/ -# Translations -*.mo -*.pot - -# Django stuff: +# Django *.log local_settings.py db.sqlite3 db.sqlite3-journal -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# PyBuilder -target/ - # IPython profile_default/ ipython_config.py @@ -85,15 +74,12 @@ ipython_config.py # pipenv Pipfile.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff +# Celery celerybeat-schedule celerybeat.pid -# SageMath parsed files -*.sage.py +# Airspeed Velocity +.asv # Environments .env @@ -126,11 +112,12 @@ dmypy.json /site index.md docs/_build/ -docs/src/_build/ docs/api -docs/index.md docs/html +docs/index.md docs/jupyter_execute +docs/src/_build/ +docs/superpowers index.md # JS @@ -141,13 +128,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -physics_workload/extension # Jupyter .ipynb_checkpoints .autoversion -!physics_workload/extension/physics_workload.json -!physics_workload/extension/install.json +Untitled*.ipynb +physics_workload/extension physics_workload/nbextension physics_workload/labextension @@ -157,8 +143,20 @@ physics_workload/labextension # Rust target +<<<<<<< before updating # Project staticfiles/ *.csv *.xlsx -*/migrations/* \ No newline at end of file +*/migrations/* +======= +# Hydra +outputs/ +multirun/ + +# AI +ROADMAP.md +AGENTS.md +.github/hooks/sdlc.json +.superpowers +>>>>>>> after updating diff --git a/Makefile b/Makefile index b559851..aeb32ad 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,24 @@ lints: lint fix: fix-py fix-docs ## run all autoformatters format: fix +<<<<<<< before updating +======= +################ +# Other Checks # +################ +.PHONY: check-dist check-types checks check + +check-dist: ## check python sdist and wheel with check-dist + check-dist -v + +check-types: ## check python types with ty + ty check --python $$(which python) + +checks: check-dist + +# Alias +check: checks +>>>>>>> after updating ######### # TESTS # diff --git a/pyproject.toml b/pyproject.toml index cba97b2..e8ab580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,23 @@ [build-system] -requires = ["hatchling"] -build-backend="hatchling.build" +requires = [ + "hatchling", +] +build-backend = "hatchling.build" [project] name = "physics-workload" -authors = [{name = "Sam Mangham", email = "s.mangham@soton.ac.uk"}] +authors = [ + {name = "Sam Mangham", email = "s.mangham@soton.ac.uk"}, +] description = "Tool for managing staff teaching time." readme = "README.md" license = { text = "Apache-2.0" } version = "0.1.0" +<<<<<<< before updating requires-python = ">=3.11" +======= +requires-python = ">=3.10" +>>>>>>> after updating keywords = [] classifiers = [ @@ -18,11 +26,11 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ @@ -51,15 +59,16 @@ dependencies = [ develop = [ "build", "bump-my-version", - "check-manifest", - "codespell>=2.4,<2.5", + "check-dist", + "codespell", "hatchling", - "mdformat>=0.7.22,<0.8", + "mdformat", "mdformat-tables>=1", "pytest", "pytest-cov", "ruff", "twine", + "ty", "uv", "wheel", "django-fastdev", @@ -93,6 +102,7 @@ branch = true omit = [ "physics_workload/tests/integration/", ] + [tool.coverage.report] exclude_also = [ "raise NotImplementedError", @@ -109,32 +119,60 @@ artifacts = [] src = "/" [tool.hatch.build.targets.sdist] -packages = ["physics_workload"] +packages = [ + "physics_workload", +] [tool.hatch.build.targets.wheel] -packages = ["physics_workload"] +packages = [ + "physics_workload", +] [tool.hatch.build.targets.wheel.shared-data] [tool.pytest.ini_options] -addopts = ["-vvv", "--junitxml=junit.xml"] +addopts = [ + "-vvv", + "--junitxml=junit.xml", +] testpaths = "physics_workload/tests" [tool.ruff] line-length = 150 [tool.ruff.lint] -extend-select = ["I"] +extend-select = [ + "I", +] [tool.ruff.lint.isort] combine-as-imports = true default-section = "third-party" +<<<<<<< before updating known-first-party = ["physics_workload", "app", "core", "users"] section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401", "F403"] "*.py" = ["E731"] +======= +known-first-party = [ + "physics_workload", +] +section-order = [ + "future", + "standard-library", + "third-party", + "first-party", + "local-folder", +] + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = [ + "F401", + "F403", +] +>>>>>>> after updating [tool.yardang] title = "Teaching Time Tool"