Skip to content

Commit 9bf5538

Browse files
authored
v1.2.0
version 1.2.0
2 parents 408148a + 7bbd00a commit 9bf5538

File tree

5 files changed

+1767
-37
lines changed

5 files changed

+1767
-37
lines changed

.github/workflows/pypi.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ jobs:
88
name: Build and publish package to PyPI
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- name: Check out repository code
12+
uses: actions/checkout@v4
13+
1214
- name: Set up Python
13-
uses: actions/setup-python@v1
15+
uses: astral-sh/setup-uv@v5
1416
with:
15-
python-version: "3.9"
16-
- name: Install poetry
17-
run: |
18-
curl -fsS -o get-poetry.py https://install.python-poetry.org
19-
python get-poetry.py -y
17+
enable-cache: true
18+
python-version: "3.11"
19+
20+
- name: Build
21+
run: uv build
22+
2023
- name: Publish
2124
env:
2225
PYPI_TOKEN: ${{ secrets.pypi_password }}
23-
run: |
24-
$HOME/.local/bin/poetry config pypi-token.pypi $PYPI_TOKEN
25-
$HOME/.local/bin/poetry build -f sdist
26-
$HOME/.local/bin/poetry publish
26+
run: uv publish --token $PYPI_TOKEN

.pre-commit-config.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 21.12b0
2+
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
3+
- repo: https://github.com/psf/black-pre-commit-mirror
4+
rev: 25.1.0
45
hooks:
56
- id: black
6-
language_version: python3.9
7+
# It is recommended to specify the latest version of Python
8+
# supported by your project here, or alternatively use
9+
# pre-commit's default_language_version, see
10+
# https://pre-commit.com/#top_level-default_language_version
11+
language_version: python3.11
12+
- repo: https://github.com/pycqa/flake8
13+
rev: '7.3.0' # pick a git hash / tag to point to
14+
hooks:
15+
- id: flake8

pyobs_flipro/fliprocamera.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import logging
33
import math
4-
from datetime import datetime
4+
from datetime import datetime, timezone
55
from typing import Tuple, Any, Optional, Dict, List
66
import numpy as np
77

@@ -160,7 +160,7 @@ async def _expose(self, exposure_time: float, open_shutter: bool, abort_event: a
160160
log.info(
161161
"Starting exposure with %s shutter for %.2f seconds...", "open" if open_shutter else "closed", exposure_time
162162
)
163-
date_obs = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")
163+
date_obs = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")
164164

165165
# start exposure
166166
self._driver.start_exposure()

pyproject.toml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyobs-flipro"
3-
version = "1.1.5"
3+
version = "1.2.0"
44
description = "pyobs module for FLIPRO cameras"
5-
authors = ["Tim-Oliver Husser <[email protected]>"]
5+
authors = [{ name = "Tim-Oliver Husser", email = "[email protected]" }]
6+
requires-python = ">=3.11"
67
license = "MIT"
7-
include = ['lib']
8+
dependencies = [
9+
"astropy>=7.0.1,<8",
10+
"numpy>=2.2.5,<3",
11+
"pyobs-core>=1,<2",
12+
]
813

9-
[tool.poetry.build]
10-
script = "build.py"
11-
generate-setup-file = false
14+
[dependency-groups]
15+
dev = [
16+
"black>=25.1.0,<26",
17+
"pre-commit>=4.2.0,<5",
18+
"flake8>=7.3.0",
19+
"sphinx-rtd-theme>=1.0.0,<2",
20+
"Sphinx>=4.4.0,<5",
21+
"Cython>=0.29.26,<0.30",
22+
]
1223

13-
[tool.poetry.dependencies]
14-
python = ">=3.9,<3.12"
15-
astropy = "^5.0"
16-
numpy = "^1.21"
17-
pyobs-core = ">=0.16.0"
24+
[tool.hatch.build.targets.sdist]
25+
include = ["lib"]
1826

19-
[tool.poetry.dev-dependencies]
20-
black = "^21.12b0"
21-
pre-commit = "^2.16.0"
22-
sphinx-rtd-theme = "^1.0.0"
23-
Sphinx = "^4.4.0"
24-
Cython = "^0.29.26"
27+
[tool.hatch.build.targets.wheel]
28+
include = ["lib"]
2529

2630
[build-system]
27-
requires = ["poetry-core>=1.0.0", "Cython>=0.29.0", "numpy>=1.21.0", "setuptools"]
28-
build-backend = "poetry.core.masonry.api"
31+
requires = ["hatchling"]
32+
build-backend = "hatchling.build"
2933

3034
[tool.black]
3135
line-length = 120
32-
target-version = ['py39']
36+
target-version = ['py39']

0 commit comments

Comments
 (0)