Skip to content

Commit

Permalink
switched to src layout, updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
arnobaer committed Jan 8, 2025
1 parent 8bb184a commit 96cd56c
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 35 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,36 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
- uses: actions/cache@v4
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
- uses: actions/cache@v4
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
- name: Lint with flake8
pip install tox
pip install .
- name: Test with tox
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# 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
- name: Test with pytest
tox -epy
- name: Run application
run: |
pytest
python -m pqc --version
4 changes: 2 additions & 2 deletions .github/workflows/windows-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10
- name: Install dependencies
Expand Down
6 changes: 5 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.47.0] - 2023-10-18
## [0.47.0] - 2025-01-08
### Changed
- Refactored code to pass mypy all tests (#212).
- Switched to pyproject.toml config.
- Switched to ruff linter.
- Dropped support for Python 3.8.
- Added support for Python 3.12 and 3.13.

### Fixed
- Reset sequence state for group items correctly.
Expand Down
2 changes: 1 addition & 1 deletion pyinstaller/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ wheel
pyusb==1.2.1
pyserial==3.5
gpib-ctypes==0.3.0
pyinstaller==6.1.0
pyinstaller==6.7.0
pyinstaller-versionfile==2.1.1
2 changes: 1 addition & 1 deletion pyinstaller/windows_app.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ app_filename = f"pqc-{app_version}.exe"
app_icon = os.path.join(app_root, "assets", "icons", "pqc.ico")
app_title = "PQC"
app_description = "Process Quality Control for CMS outer tracker"
app_copyright = "Copyright © 2019-2024 HEPHY"
app_copyright = "Copyright © 2019-2025 HEPHY"
app_organization = "HEPHY"

# Entry point for the application
Expand Down
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
[project]
name = "pqc"
description = "Process Quality Control for CMS outer tracker"
readme = "README.md"
authors = [
{name = "Bernhard Arnold", email = "bernhard.arnold@oeaw.ac.at"},
]
classifiers = [
"Framework :: PyQt5",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
dependencies = [
"comet @ git+https://github.com/hephy-dd/comet.git@0.13.2",
"analysis-pqc @ git+https://github.com/hephy-dd/analysis-pqc.git@0.8.2",
"PyVISA==1.14.1",
"PyVISA-py==0.7.2",
"PyQt5==5.15.11",
"PyQtChart==5.15.7",
"PyYAML==6.0.2",
"jsonschema==3.2.0",
"flask==3.1.0",
"waitress==3.0.2",
]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/hephy-dd/comet-pqc/"
Documentation = "https://hephy-dd.github.io/comet-pqc/"

[project.scripts]
pqc = "pqc.__main__:main"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "pqc.__version__"}

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"pqc.assets.config.chuck" = ["*.yaml"]
"pqc.assets.config.sample" = ["*.yaml"]
"pqc.assets.config.sequence" = ["*.yaml"]
"pqc.assets.icons" = ["*.svg", "*.png", "*.ico"]
"pqc.assets.schema" = [
"chuck.yaml",
"sample.yaml",
"sequence.yaml",
]
2 changes: 1 addition & 1 deletion src/pqc/view/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
__all__ = ["MainWindow"]

APP_TITLE = "PQC"
APP_COPY = "Copyright © 2020-2024 HEPHY"
APP_COPY = "Copyright © 2020-2025 HEPHY"
APP_LICENSE = "This software is licensed under the GNU General Public License v3.0"
APP_DECRIPTION = """Process Quality Control (PQC) for CMS Tracker."""

Expand Down
1 change: 0 additions & 1 deletion src/pqc/view/panels/panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Callable, Dict, Optional

from PyQt5 import QtCore, QtWidgets
from QCharted import ChartView

import comet

Expand Down
6 changes: 0 additions & 6 deletions tests/test_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
from pqc.core import utils


def test_package_path():
root_path = os.path.dirname(os.path.dirname(__file__))
package_path = os.path.join(root_path, "pqc")
assert package_path == utils.PACKAGE_PATH


def test_make_path():
filename = os.path.join(utils.PACKAGE_PATH, "assets", "sample.txt")
assert filename == utils.make_path("assets", "sample.txt")
Expand Down
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[tox]
envlist = py38, py39, py310, py311
envlist = py39, py310, py311, py312, py313
isolated_build = true
skip_missing_interpreters = true

[testenv]
deps =
flake8
pylint
ruff
mypy
PyQt5-stubs
types-PyYAML
Expand All @@ -15,7 +14,6 @@ deps =
types-waitress
pytest
commands =
flake8 pqc --count --select=E9,F63,F7,F82 --show-source --statistics
pylint -E pqc
mypy pqc
ruff check src --select=E9,F63,F7,F82
mypy src
pytest

0 comments on commit 96cd56c

Please sign in to comment.