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
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [develop, main, master]
pull_request:
branches: [develop, main, master]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "pokrok @ git+https://github.com/jdidion/pokrok.git@maintenance/modernize-packaging"
pip install -e ".[test]"
- name: Run tests
run: |
pytest -m "not perf" -vv --cov --cov-report term-missing tests
68 changes: 68 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "xphyle"
dynamic = ["version"]
description = "Utilities for working with files."
readme = {file = "README.md", content-type = "text/markdown"}
license = {text = "MIT"}
requires-python = ">=3.10"
authors = [
{name = "John Didion", email = "github@didion.net"},
]
dependencies = [
"pokrok",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
"License :: Public Domain",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[project.optional-dependencies]
performance = ["lorem"]
zstd = ["zstandard"]
test = ["pytest", "pytest-cov"]

[project.urls]
Homepage = "https://github.com/jdidion/xphyle"

[tool.setuptools]
packages = ["xphyle"]

[tool.setuptools_scm]

[tool.pytest.ini_options]
markers = [
"perf: marks performance tests",
]

[tool.coverage.run]
omit = [
"tests/*",
"setup.py",
"*site-packages/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pragma: no-cover",
"def __repr__",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]

[tool.ruff]
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "W"]
6 changes: 3 additions & 3 deletions xphyle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
cast,
)

import pkg_resources
from importlib.metadata import version, PackageNotFoundError

from xphyle.formats import FORMATS, THREADS, CompressionFormat
from xphyle.paths import (
Expand Down Expand Up @@ -65,8 +65,8 @@


try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = "Unknown"


Expand Down
Loading