diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5ffcfb8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + # manually triggered + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "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: Setup venv + run: | + python -m venv .env + .env/bin/pip install '.[testing]' + - name: Tests + run: .env/bin/pytest -v + - name: Tests with Flux + run: | + .env/bin/pip install flux + .env/bin/pytest -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dda5884..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: python -sudo: false -python: -- 3.5 -- 3.6 -- 3.7 -- 3.8 -env: - matrix: - - ADDITIONAL_SETUP="pip install flux" - - ADDITIONAL_SETUP=":" -install: -- pip install -e ".[testing]" -- $ADDITIONAL_SETUP -script: pytest tests -deploy: - provider: pypi - user: vmalloc - password: - secure: ujgrZvEm1GIqAJ44g54kJol51/odRYOt3fcqobzpR1LUbiUzI/h0YeuoIKYlCJPqhdGZK3k1C6JrE2dHxZAcP5ozncRgRtBhE0mNbrmnmbkZJxlfCWg0ZHeA0tMPUk53qgB8drCFc6TstAwvDIdgUAtfvqNpQjY49ECciXlyE7Q= - on: - tags: true - repo: vmalloc/waiting diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..90ebbc5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["hatchling>=0.25.1", "hatch-vcs"] +build-backend = "hatchling.build" + + +[project] +name = "waiting" +description = "Utility for waiting for stuff to happen" +readme = "README.rst" +requires-python = ">=3.8" +license = { text = "BSD 3-Clause License" } + +classifiers = [ + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +dependencies = [] +dynamic = ["version"] + +authors = [{ name = "Rotem Yaari", email = "vmalloc@gmail.com" }] + +[project.urls] +"Homepage" = "https://github.com/getslash/waiting" + +[project.optional-dependencies] +testing = ["pyforge", "pytest"] + +[tool.hatch.version] +source = "vcs" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a91eeea..0000000 --- a/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[metadata] -name = waiting -classifiers = - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 -summary = Utility for waiting for stuff to happen -description-file = - README.rst -description-content-type = text/markdown -license = BSD3 -author = Rotem Yaari -author_email = vmalloc@gmail.com -url = https://github.com/vmalloc/waiting - -[extras] -testing = - pytest - pyforge - -[tool:pytest] -testpaths = tests diff --git a/setup.py b/setup.py deleted file mode 100644 index bc26f2b..0000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup - - -setup( - setup_requires=['pbr>=3.0', 'setuptools>=17.1'], - pbr=True, - python_requires=">=3.5.*", - long_description_content_type='text/markdown; charset=UTF-8', -) diff --git a/waiting/__init__.py b/waiting/__init__.py index 538dd25..0407ae7 100644 --- a/waiting/__init__.py +++ b/waiting/__init__.py @@ -1,7 +1,6 @@ -import inspect import sys -from .__version__ import __version__ +from .__version__ import __version__ as __version__ from contextlib import contextmanager try: diff --git a/waiting/__version__.py b/waiting/__version__.py index b815e68..c304f07 100644 --- a/waiting/__version__.py +++ b/waiting/__version__.py @@ -1,3 +1,4 @@ -import pkg_resources +from importlib.metadata import distribution -__version__ = pkg_resources.get_distribution('waiting').version + +__version__ = distribution("waiting").version