Skip to content
Merged
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
9 changes: 3 additions & 6 deletions .github/scripts/check_template_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
------------------------------------------------
1. Create the ``5.4.x`` branch from ``5.3.x`` and make it the default branch of the template repository.
2. On it, raise the floors in pyproject.toml (``pymodaq>=5.4.0``...), the "PyMoDAQ 5.3.x" wording in README.rst and
AGENTS.md, the Python classifiers/requires-python and the matrix of reusable-compatibility.yml if they changed.
AGENTS.md, requires-python and the matrix of reusable-compatibility.yml if they changed.
3. Point the three caller workflows (``@5.3.x`` in tests.yml, compatibility.yml, python-publish.yml) to ``@5.4.x``.
4. Run this script: it must print OK. Keep ``5.3.x`` for hotfixes.
"""
Expand Down Expand Up @@ -78,11 +78,8 @@ def main() -> int:
same_minor = [v for v in versions if minor(v) == branch_minor][-1]
with urllib.request.urlopen(f'https://pypi.org/pypi/pymodaq/{same_minor}/json', timeout=30) as response:
data = json.load(response)['info']
theirs = python_minors(data['classifiers'])
ours = python_minors(project['classifiers'])
if theirs and ours != theirs:
problems.append(f'Python classifiers of pyproject.toml are 3.{ours[0]}-3.{ours[-1]}, pymodaq {same_minor} says '
f'3.{theirs[0]}-3.{theirs[-1]}')
# the Python classifiers of a plugin are computed from requires-python when it is built (dynamic classifiers)
ours = theirs = python_minors(data['classifiers'])
requires = data.get('requires_python') or ''
if requires and requires != project.get('requires-python'):
problems.append(f'requires-python is {project.get("requires-python")!r}, pymodaq {same_minor} has {requires!r}')
Expand Down
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ File and class names must match: `daq_move_<Name>.py` holds `DAQ_Move_<Name>`; `
to develop them. The list is defined once in `pymodaq_utils.plugin_tools.contract`, with when each method is called and
what it returns (table in the developer guide, "The methods of a plugin").

- (Actuators and detectors.) A plugin that works on some systems only (a Windows driver, a Raspberry Pi board)
declares it in the instrument class, for instance `supported_platforms = ('win32',)` (values of `sys.platform`:
`win32`, `linux`, `darwin`) and optionally `supported_architectures = ('aarch64', 'armv7l')` (values of
`platform.machine()`). PyMoDAQ then refuses to initialize it elsewhere with a message. The `Operating System` and
`Programming Language :: Python :: 3.x` classifiers are computed when the package is built (`classifiers` is
dynamic in the `pyproject.toml`, the others are in `[tool.pymodaq] classifiers`). A plugin working on several
systems must stay importable on all of them: import Windows-only code lazily (PMQ317; not reported when every
instrument is `('win32',)`). Needs `pymodaq>=5.3.6`.
- `ini_stage(controller=None)` returns `(info: str, initialized: bool)`. If `self.is_master`, create the controller;
otherwise store the `controller` passed in (several axes share one controller).
- Class attributes: `is_multiaxes`, `_axis_names`, `_controller_units`, `_epsilons`,
Expand Down
33 changes: 15 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,16 @@ maintainers = [

# nottodo: leave everything below as is!

dynamic = ["version", "urls", "entry-points"]
dynamic = ["version", "urls", "entry-points", "classifiers"]
readme = "README.rst"
license = { file="LICENSE" }
requires-python = ">=3.10"

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: User Interfaces",
]

[build-system]
requires = [
"hatchling>=1.9.0",
"hatch-vcs", "toml",
"pymodaq_utils>=0.0.6",
"pymodaq_utils>=5.3.6",
]
build-backend = "hatchling.build"

Expand All @@ -64,3 +48,16 @@ build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"

[tool.pymodaq]
# the "Operating System" and "Programming Language :: Python :: 3.x" classifiers are added when building the package,
# from supported_platforms in your instrument plugins and from requires-python
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: User Interfaces",
]
Loading