Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d8bc6bc
first draft of applying cookie template
jennmald Jul 31, 2025
1f7f822
remove dependency on my fork
jennmald Aug 19, 2025
5023304
pre-commit changes
jennmald Aug 19, 2025
e71dae8
more formatting work
jennmald Aug 19, 2025
a948807
ruff fixes for versioneer
jennmald Aug 22, 2025
d0a2ba9
fix ruff for setup.py
jennmald Aug 22, 2025
0935a26
fix transforms with ruff
jennmald Aug 22, 2025
d50684d
ruff fixes for xspress3 tests
jennmald Aug 22, 2025
d6388df
ruff formatting
jennmald Aug 22, 2025
78fc010
more ruff formatting for tests
jennmald Aug 25, 2025
c42382d
ruff formatting finished for tests and started temp controllers
jennmald Aug 25, 2025
edd4a04
add ruff formatting to ophyd async and plans
jennmald Aug 25, 2025
13e9679
ruff formatting for common, detectors, and iocs
jennmald Aug 27, 2025
bd74263
finished ruff fixes for nslsii
jennmald Aug 29, 2025
25eede6
fix ruff format with pre-commit
jennmald Aug 29, 2025
2a3fcfd
fix test file names
jennmald Sep 3, 2025
50d23b2
fix rst-backticks
jennmald Sep 3, 2025
090ec27
fix codespell
jennmald Sep 3, 2025
f22755f
remove mypy
jennmald Sep 4, 2025
42dcd92
add versioneer
jennmald Sep 4, 2025
51c2914
satisfy pylint
jennmald Sep 4, 2025
ccf86ef
add versioneer to dev dependencies
jennmald Sep 4, 2025
f8e1532
build versioneer:
jennmald Sep 4, 2025
9e06067
fix setup.py
jennmald Sep 4, 2025
a5093c1
fix joinpath
jennmald Sep 4, 2025
fbaa7ce
fix path dirname
jennmald Sep 4, 2025
11b54ba
fix a few Path errors:
jennmald Sep 4, 2025
8584c0c
fix ophyd async version
jennmald Sep 4, 2025
b2c8f94
typo for ophyd async version
jennmald Sep 4, 2025
f37f532
remove kafka tests
jennmald Sep 4, 2025
0d46396
move nslsii to src
jennmald Sep 9, 2025
7c7a985
pre-commit for new files
jennmald Sep 9, 2025
a0b27a9
add src path
jennmald Sep 9, 2025
d4bfe03
try to fix path for contest
jennmald Sep 9, 2025
0ac5807
fix versioneer
jennmald Sep 10, 2025
22bb24f
move tests and fix versioneer
jennmald Sep 10, 2025
dc22b16
fix version
jennmald Sep 10, 2025
0b96179
rename version.py
jennmald Sep 10, 2025
70f4ba8
fix get versions
jennmald Sep 10, 2025
023615c
change None to Close
jennmald Sep 10, 2025
79f668e
fix none to close tyep
jennmald Sep 10, 2025
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
12 changes: 12 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 06352e2
_src_path: cookie
backend: setuptools
email: dssi@bnl.gov
full_name: NSLS2
license: BSD
org: NSLS-II
project_name: nslsii
project_short_description: NSLS-II related devices
url: https://github.com/NSLS-II/nslsii
vcs: true
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nsls-ii-tools/_version.py export-subst
src/nslsii/_version.py export-subst
77 changes: 77 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
description of best practices for developing scientific packages.

[spc-dev-intro]: https://learn.scientific-python.org/development/

# Quick development

The fastest way to start with development is to use nox. If you don't have nox,
you can use `uvx nox` to run it without installing, or `uv tool install nox`. If
you don't have uv, you can
[install it a variety of ways](https://docs.astral.sh/uv/getting-started/installation/),
including with pip, pipx, brew, and just downloading the binary (single file).

To use, run `nox`. This will lint and test using every installed version of
Python on your system, skipping ones that are not installed. You can also run
specific jobs:

```console
$ nox -s lint # Lint only
$ nox -s tests # Python tests
$ nox -s docs # Build and serve the docs
$ nox -s build # Make an SDist and wheel
```

Nox handles everything for you, including setting up an temporary virtual
environment for each run.

# Setting up a development environment manually

You can set up a development environment by running:

```bash
uv sync
```

# Pre-commit

You should prepare pre-commit, which will help you by checking that commits pass
required checks:

```bash
uv tool install pre-commit # or brew install pre-commit on macOS
pre-commit install # Will install a pre-commit hook into the git repo
```

You can also/alternatively run `pre-commit run` (changes only) or
`pre-commit run --all-files` to check even without installing the hook.

# Testing

Use pytest to run the unit checks:

```bash
uv run pytest
```

# Coverage

Use pytest-cov to generate coverage reports:

```bash
uv run pytest --cov=nslsii
```

# Building docs

You can build and serve the docs using:

```bash
nox -s docs
```

You can build the docs only with:

```bash
nox -s docs --non-interactive
```
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
60 changes: 60 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CD

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3

jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2

publish:
needs: [dist]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
attestations: write
contents: read
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v2
with:
subject-path: "dist/*"

- uses: pypa/gh-action-pypi-publish@release/v1
with:
# Remember to tell (test-)pypi about this repo before publishing
# Remove this line to publish to PyPI
repository-url: https://test.pypi.org/legacy/
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Many color libraries just need this variable to be set to any value.
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
# for libraries that care about the value set.
FORCE_COLOR: 3

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"

- uses: astral-sh/setup-uv@v6

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, windows-latest, macos-14]

include:
- python-version: "pypy-3.10"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- uses: astral-sh/setup-uv@v6

- name: Install package
run: uv sync

- name: Test package
run: >-
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20

- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -23,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"

- name: Build package
run: |
Expand Down
69 changes: 35 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on:
push:
pull_request:
schedule:
- cron: '00 4 * * *' # daily at 4AM
- cron: "00 4 * * *" # daily at 4AM

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand All @@ -17,35 +16,37 @@ jobs:

fail-fast: false
steps:

- uses: actions/checkout@v2

- name: Start Redis
uses: supercharge/redis-github-action@1.4.0

- name: start Kafka and Zookeeper
run: docker compose -f scripts/bitnami-kafka-docker-compose.yml up -d

- name: is Kafka running?
run: docker ps -a

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install
shell: bash -l {0}
run: |
set -vxeuo pipefail
pip install --upgrade pip wheel
pip install .
pip install -r requirements-dev.txt
pip list

- name: Test with pytest
shell: bash -l {0}
run: |
set -vxeuo pipefail
coverage run -m pytest -s -v
coverage report
- uses: actions/checkout@v2

- name: Start Redis
uses: supercharge/redis-github-action@1.4.0

- name: start Kafka and Zookeeper
run: docker compose -f scripts/bitnami-kafka-docker-compose.yml up -d

- name: is Kafka running?
run: docker ps -a

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install
shell: bash -l {0}
run: |
set -vxeuo pipefail
pip install --upgrade pip wheel
pip install .
pip install -r requirements-dev.txt
pip list

- name: Add src to PYTHONPATH
run: echo "PYTHONPATH=$PWD/src" >> $GITHUB_ENV

- name: Test with pytest
shell: bash -l {0}
run: |
set -vxeuo pipefail
coverage run -m pytest -s -v
coverage report
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ ENV/
.mypy_cache/

#
.DS_Store
.DS_Store
Loading
Loading