Skip to content

Commit 28fa813

Browse files
authored
feat: Drop support for Python 3.7 (#10)
1 parent dc7f5ce commit 28fa813

File tree

4 files changed

+60
-38
lines changed

4 files changed

+60
-38
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
49-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
49+
python-version: ['3.8', '3.9', '3.10', '3.11']
5050

5151
steps:
5252
- uses: actions/checkout@v3
@@ -60,29 +60,3 @@ jobs:
6060
run: |
6161
pipx install hatch
6262
hatch run test
63-
64-
Release:
65-
# this will run when you have tagged a commit, starting with "v*"
66-
# and requires that you have put your twine API key in your
67-
# github secrets (see readme for details)
68-
needs: [Test]
69-
runs-on: ubuntu-latest
70-
if: contains(github.ref, 'tags')
71-
steps:
72-
- uses: actions/checkout@v3
73-
- name: Set up Python
74-
uses: actions/setup-python@v4
75-
with:
76-
python-version: "3.x"
77-
- name: Install dependencies
78-
run: |
79-
python -m pip install --upgrade pip
80-
pip install build twine
81-
- name: Build and publish
82-
env:
83-
TWINE_USERNAME: __token__
84-
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
85-
run: |
86-
git tag
87-
python -m build .
88-
twine upload dist/*

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
workflow_dispatch:
11+
12+
jobs:
13+
14+
Release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.x"
24+
25+
- run: |
26+
pipx install hatch
27+
hatch build
28+
29+
- name: Publish package to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.TWINE_API_KEY }}
33+
34+
- uses: actions/setup-node@v3
35+
with:
36+
node-version: 16.x
37+
38+
- run: npx changelogithub@0.12
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ classifiers = [
2323
"Operating System :: OS Independent",
2424
]
2525
url = { homepage = "https://github.com/higlass/higlass-schema" }
26-
requires-python = ">=3.7"
26+
requires-python = ">=3.8"
2727
dynamic = ["version"]
2828
dependencies = [
29-
"importlib_metadata ; python_version < '3.8'",
3029
"pydantic>=1.10,<2.0",
3130
"rich>=13.3.3",
3231
]
@@ -51,14 +50,21 @@ source = "vcs"
5150
features = ["dev"]
5251

5352
[tool.hatch.envs.default.scripts]
54-
fix = "black . && ruff --fix ."
55-
lint = "black --check . && ruff ."
53+
lint = [
54+
"ruff {args:.}",
55+
"black --check --diff {args:.}",
56+
]
57+
fmt = [
58+
"black {args:.}",
59+
"ruff --fix {args:.}",
60+
"lint",
61+
]
5662
test = "pytest ."
5763

5864
# https://github.com/charliermarsh/ruff
5965
[tool.ruff]
6066
line-length = 88
61-
target-version = "py37"
67+
target-version = "py38"
6268
src = ["src", "tests"]
6369
extend-select = [
6470
"E", # style errors

src/higlass_schema/schema.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,26 @@ class AxisSpecificLocks(BaseModel):
228228

229229

230230
class LocationLocks(BaseModel):
231-
locksByViewUid: Dict[str, Union[str, AxisSpecificLocks]] = {}
232-
locksDict: Dict[str, Lock] = {}
231+
locksByViewUid: Dict[str, Union[str, AxisSpecificLocks]] = Field(
232+
default_factory=dict
233+
)
234+
locksDict: Dict[str, Lock] = Field(default_factory=dict)
233235

234236

235237
class ZoomLocks(BaseModel):
236238
class Config:
237239
extra = Extra.forbid
238240

239-
locksByViewUid: Dict[str, str] = {}
240-
locksDict: Dict[str, Lock] = {}
241+
locksByViewUid: Dict[str, str] = Field(default_factory=dict)
242+
locksDict: Dict[str, Lock] = Field(default_factory=dict)
241243

242244

243245
class ValueScaleLocks(BaseModel):
244246
class Config:
245247
extra = Extra.forbid
246248

247-
locksByViewUid: Dict[str, str] = {}
248-
locksDict: Dict[str, ValueScaleLock] = {}
249+
locksByViewUid: Dict[str, str] = Field(default_factory=dict)
250+
locksDict: Dict[str, ValueScaleLock] = Field(default_factory=dict)
249251

250252

251253
##################################################

0 commit comments

Comments
 (0)