Skip to content

Commit

Permalink
Merge branch 'main' into run_job
Browse files Browse the repository at this point in the history
  • Loading branch information
ndevenish committed Jan 16, 2025
2 parents dcc7a5f + 26d1b1c commit 5dcd8e7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 44 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ defaults:
shell: bash -l {0}

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Lint with Ruff
run: |
pip install ruff
ruff --output-format=github --target-version=py39 .
continue-on-error: true

Build:
runs-on: ubuntu-latest
steps:
Expand All @@ -41,7 +27,7 @@ jobs:
run: |
python -m build
pip install dist/*.whl
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./dist/*

Expand All @@ -52,19 +38,19 @@ jobs:
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: macos-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: macos-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.11"
runs-on: ${{ matrix.os }}
# runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down Expand Up @@ -98,7 +84,7 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
23 changes: 9 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
repos:
ci:
autoupdate_schedule: quarterly

# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 23.9.1
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: black
args: [--safe, --quiet]
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format

# Syntax check and some basic
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-ast

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

6 changes: 3 additions & 3 deletions fast_dp/image_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import time

from dxtbx.model.experiment_list import ExperimentList
from dxtbx.model.experiment_list import ExperimentListFactory

from fast_dp.image_names import image2template_directory

Expand Down Expand Up @@ -323,11 +323,11 @@ def read_image_metadata_dxtbx(image):
if image.endswith(".h5"):
# XDS can literally only handle master files called (prefix)_master.h5
assert "master" in image
expt = ExperimentList.from_filenames([image])[0]
expt = ExperimentListFactory.from_filenames([image])[0]
else:
template, directory = image2template_directory(image)
full_template = os.path.join(directory, template)
expt = ExperimentList.from_templates(
expt = ExperimentListFactory.from_templates(
[full_template], allow_incomplete_sweeps=True
)[0]

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX :: Linux",
]
dependencies = ["procrunner"]

[project.urls]
Homepage = "https://github.com/DiamondLightSource/fast_dp"
Expand Down
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pytest==7.4.2
procrunner==2.3.3
pytest-cov==4.1.0

0 comments on commit 5dcd8e7

Please sign in to comment.