diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d5160d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: "Continuous Integration" + + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: "0 2 * * *" + +jobs: + tests: + name: python ${{ matrix.python-version }} tests, ${{ matrix.uv-resolution }} dependencies + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + uv-resolution: + - "lowest" + - "highest" + steps: + - uses: actions/checkout@v4 + + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + cache-dependency-glob: "**/pyproject.toml" + cache-suffix: ${{ matrix.uv-resolution }} + + - name: Install the project + run: uv sync --all-extras --dev --resolution ${{ matrix.uv-resolution }} + + - name: Run tests + run: | + uv run pytest --sqlalchemy-connect-url="sqlite:///foo.sqlite" diff --git a/.gitignore b/.gitignore index ba74660..b20aca4 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ docs/_build/ # PyBuilder target/ + +# Don't source control the lock file +uv.lock diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fb6698f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -python: - - 2.6 - - 2.7 - - 3.3 - - 3.4 - - 3.5 - - pypy - - pypy3 - -script: - - python setup.py install - - py.test --sqlalchemy-connect-url="sqlite:///foo.sqlite" diff --git a/README.md b/README.md index b533224..ab93407 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,16 @@ Or override the `sqlalchemy_connect_url` fixture on your conftest file: def sqlalchemy_connect_url(): return 'postgresql://scott:tiger@localhost:5432/mydatabase' +## Development + +To get going, in a checkout: + +```bash +uv sync +``` + +You can then run the tests with: + +```bash +uv run pytest +``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..40b6928 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[project] +name = "pytest-sqlalchemy" +version = "0.2.0" +description = "pytest plugin with sqlalchemy related fixtures" +authors = [ + { name = "Torsten Irländer", email = "torsten.irlaender@googlemail.com" } +] +license = {text = "MIT"} +readme = "README.rst" +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 3 - Alpha", + "Topic :: Software Development :: Testing", + "Intended Audience :: Developers", + "Operating System :: OS Independent", +] +dependencies = [ + "pytest>=8.0", + "sqlalchemy>=1.4", + "SQLAlchemy-Utils>=0.41" +] + +[dependency-groups] +dev = [ + # https://github.com/sqlalchemy/sqlalchemy/pull/12459: + "greenlet>=3.1" +] + +[project.urls] +Homepage = "http://github.com/toirl/pytest-sqlalchemy/" + +[project.entry-points.pytest11] +sqlalchemy = "pytest_sqlalchemy" + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py deleted file mode 100644 index 1f43d9a..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 - -import os -from setuptools import setup - -# Utility function to read the README file. -# Used for the long_description. It's nice, because now 1) we have a top level -# README file and 2) it's easier to type in the README file than to put a raw -# string in below ... -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() - -setup( - name='pytest-sqlalchemy', - license='MIT', - description='pytest plugin with sqlalchemy related fixtures', - #long_description=read("README.rst"), - version='0.2.0', - author='Torsten Irländer', - author_email='torsten.irlaender@googlemail.com', - url='http://github.com/toirl/pytest-sqlalchemy/', - py_modules=['pytest_sqlalchemy'], - entry_points={'pytest11': ['sqlalchemy = pytest_sqlalchemy']}, - install_requires=['pytest>=2.0', 'sqlalchemy', 'SQLAlchemy-Utils'], - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Topic :: Software Development :: Testing', - 'Intended Audience :: Developers', - 'Operating System :: OS Independent', - ] -)