diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..d1f3776 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @kraken-tech/laboratory-maintainers @kraken-tech/open-source-maintainers diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..71d9031 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..f80a9b3 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,35 @@ +name: tests + +on: + pull_request: + push: + branches: [master] + +# Only allow one instance of this workflow for each PR. +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + tests: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 + with: + python-version: | + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + 3.14 + allow-prereleases: true + cache-dependency-path: | + pyproject.toml + - run: pip install tox tox-uv + - run: tox run-parallel --parallel-no-spinner + env: + FORCE_COLOR: "1" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e52a1c0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -notifications: - email: - on_success: change - on_failure: always - -language: python -python: - - "2.6" - - "2.7" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.6-dev" - - "3.7-dev" - - "nightly" - -matrix: - allow_failures: - - python: "nightly" - - python: "3.7-dev" - - python: "3.6-dev" - -script: - # setuptools only supports py 3.3 up to version 39 - - | - if [ "$TRAVIS_PYTHON_VERSION" == "3.3" ] - then - pip install -U 'setuptools<40' - else - pip install -U setuptools - fi - - pip install -U setuptools_scm - - pip install -U pip - - python setup.py test diff --git a/LICENCE b/LICENCE index f1dc24c..ce54bfe 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,5 @@ -Copyright (c) 2016 Joe Alcorn +Copyright (c) 2016, Joe Alcorn +Copyright (c) 2025, Kraken Technologies Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..039419e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,53 @@ +# Project +# ------- + +[project] +name = "laboratory" +version = "1.0.2" +authors = [ + {name = "Joe Alcorn"}, +] +description = "Sure-footed refactoring achieved through experimenting" +license = "MIT" +license-files = ["LICENSE"] +readme = "README.rst" +requires-python = ">=3.9" +dependencies = [] +classifiers = [ # pragma: alphabetize + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "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", + "Typing :: Typed", +] + +[project.urls] +Source = "https://github.com/kraken-tech/laboratory" +Changelog = "https://github.com/kraken-tech/laboratory/blob/main/CHANGELOG" + + +# Packaging +# --------- + +[build-system] +requires = ["setuptools>=77.0.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +# This is the default but we include it to be explicit. +include-package-data = true + + +# Development +# ----------- + +[dependency-groups] +test = [ + "pytest", + "mock", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 050e3df..0000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[bdist_wheel] -universal=1 - - -[aliases] -test=pytest diff --git a/setup.py b/setup.py deleted file mode 100755 index 9986c29..0000000 --- a/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -from setuptools import setup, find_packages -from os import path - -import laboratory - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, 'README.rst')) as f: - long_description = f.read() - -setup( - name='laboratory', - packages=find_packages(), - version=laboratory.__version__, - description="Sure-footed refactoring achieved through experimenting", - long_description=long_description, - author='Joe Alcorn', - author_email='joealcorn123@gmail.com', - url='https://github.com/joealcorn/laboratory', - setup_requires=['pytest-runner'], - tests_require=['pytest', 'mock'], - extras_require={ - 'dev': [ - 'Sphinx==1.6.6', - 'alabaster==0.7.12', - ] - }, - license='MIT', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.1', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Software Development :: Testing', - 'Topic :: Utilities', - ] -) diff --git a/tests/test_experiment.py b/tests/test_experiment.py index 6663980..76a3817 100644 --- a/tests/test_experiment.py +++ b/tests/test_experiment.py @@ -119,7 +119,7 @@ def test_repr(): def test_repr_with_exception(): obs = Observation("an observation") obs.set_exception(ValueError("something is wrong")) - assert repr(obs) == """Observation(name='an observation', value=Unrecorded, exception=ValueError('something is wrong',))""" + assert repr(obs) == """Observation(name='an observation', value=Unrecorded, exception=ValueError('something is wrong'))""" def test_functions_executed_in_random_order(): diff --git a/tox.ini b/tox.ini index 3ed52d5..0a0c169 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,11 @@ [tox] -envlist = py26,py27,py30,py31,py33,py34 +envlist = py3{9,10,11,12,13,14} [testenv] -commands=python setup.py test +# Install wheels instead of source distributions for faster execution. +package = wheel +# Share the build environment between tox environments. +wheel_build_env = .pkg + +dependency_groups = test +commands = python -m pytest {posargs:tests}