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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- main
- dev
- dev*
pull_request:
branches:
- main
- dev
- dev*

jobs:
build:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:

- name: Install quality check dependencies
run: |
pip install -r requirements.txt
pip install ".[dev]"

- name: Run quality checks
run: |
Expand Down
234 changes: 112 additions & 122 deletions README.md

Large diffs are not rendered by default.

58 changes: 57 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "seqscore"
dynamic = ["version"]
description = "SeqScore: Scoring for named entity recognition and other sequence labeling tasks"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Constantine Lignos", email = "lignos@brandeis.edu"},
]
requires-python = ">=3.10"
dependencies = [
"attrs>=19.2.0",
"click",
"tabulate",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

[project.urls]
Homepage = "https://github.com/bltlab/seqscore"

[project.scripts]
seqscore = "seqscore.scripts.seqscore:cli"

[project.optional-dependencies]
dev = [
"types-tabulate",
"pytest==9.0.3",
"pytest-cov==7.1.0",
"mypy==2.1.0",
"ruff==0.15.15",
"flowmark",
"build",
"twine",
]

[tool.setuptools.dynamic]
version = {attr = "seqscore.__version__"}

[tool.setuptools.packages.find]
include = ["seqscore", "seqscore.*"]

[tool.setuptools.package-data]
seqscore = ["py.typed"]

[tool.mypy]
python_version = "3.10"
strict_optional = false
Expand All @@ -6,7 +63,6 @@ disallow_untyped_calls = true

[[tool.mypy.overrides]]
module = [
"setuptools",
"click.*",
]
ignore_missing_imports = true
Expand Down
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

57 changes: 57 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Builds, uploads to PyPI, and tags the release.
# Should only be run by project maintainers.
set -euo pipefail

VENV=".venv/bin"

# Run pre-commit checks
bash tests/check.sh

# Must be on main with a clean working tree
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$current_branch" != "main" ]]; then
echo "Error: must be on main branch (currently on '$current_branch')"
exit 1
fi

if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Error: working tree is not clean"
exit 1
fi

# Read version from package
version=$("$VENV/python" -c "import seqscore; print(seqscore.__version__)")
tag="v$version"

# Abort if tag already exists
if git rev-parse "$tag" >/dev/null 2>&1; then
echo "Error: tag $tag already exists. Update __version__ in seqscore/__init__.py."
exit 1
fi

echo "Releasing $tag"

# Build
rm -rf dist/
"$VENV/python" -m build

# Tag and push
git tag "$tag"
git push origin "$tag"

# Prompt to verify tag before uploading
echo ""
echo "Tag $tag pushed. Check the release on GitHub before uploading to PyPI:"
echo " https://github.com/bltlab/seqscore/releases/tag/$tag"
echo ""
read -r -p "Upload to PyPI? [y/N] " confirm
if [[ "${confirm,,}" != "y" ]]; then
echo "Aborted. Re-run this script to retry the upload."
exit 1
fi

# Upload to PyPI
"$VENV/twine" upload dist/*

echo "Done: $tag released and pushed"
52 changes: 0 additions & 52 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

files=(seqscore/ tests/ setup.py)
flowmark --check ./*.md
files=(seqscore/ tests/)
ruff check "${files[@]}"
mypy "${files[@]}"
3 changes: 2 additions & 1 deletion tests/pre_commit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

files=(seqscore/ tests/ *.py)
flowmark -i --nobackup ./*.md
files=(seqscore/ tests/)
ruff check --fix "${files[@]}"
ruff check --select I --fix "${files[@]}" # Organize imports
ruff format "${files[@]}"
Expand Down