diff --git a/.github/workflows/skosprovider_sqlalchemy.yaml b/.github/workflows/skosprovider_sqlalchemy.yaml new file mode 100644 index 0000000..52802d9 --- /dev/null +++ b/.github/workflows/skosprovider_sqlalchemy.yaml @@ -0,0 +1,37 @@ +name: skosprovider_sqlalchemy backend tests +on: + push: + paths: + - skosprovider_sqlalchemy/** + - tests/** + - skosprovider_sqlalchemy.yaml + - pyproject.toml + - requirements*.txt +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 }} + # You can test your matrix by printing the current Python version + - name: Display Python version + run: python -c "import sys; print(sys.version)" + + - name: Install python requirements + env: + HATCH_BUILD_NO_HOOKS: true + working-directory: ./ + run: | + pip --version + pip install pip-tools + pip-sync requirements-dev.txt + pip install -e . + - name: Python tests + run: pytest tests --exitfirst --capture=no -vvv --full-trace \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index db04d29..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: python -os: linux -dist: bionic -python: - - "3.8" - - "3.9" - - "3.10" - - "3.11" -services: - - postgresql -env: - - DB="sqlite" SAURL="sqlite:///:memory:" - - DB="postgres" SAURL="postgresql://postgres:postgres@localhost/skosprovider_sqlalchemy" -install: - - pip install --upgrade pip setuptools importlib-metadata - - pip install -r requirements-dev.txt - - python setup.py -q develop -before_script: - - "if [[ $DB = 'postgres' ]]; then psql -U postgres -c 'create database skosprovider_sqlalchemy'; fi" -script: - - py.test --sqlalchemy_url $SAURL -v --cov skosprovider_sqlalchemy -after_success: coveralls diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f6dd8a5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,70 @@ +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[project] +version = "1.2.0" +name = "skosprovider_sqlalchemy" +dynamic = ["readme"] +authors = [ + { name = "Flanders Heritage Agency", email = "ict@onroerenderfgoed.be" }, +] +license = "MIT" +description = "skosprovider_sqlalchemy" +requires-python = ">=3.10,<3.13" +keywords = ["rdf", "skos", "skosprovider", "vocabularies", "thesauri"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "SQLAlchemy==2.0.35", + "skosprovider==1.2.0", +] + +[project.urls] +History = "https://github.com/OnroerendErfgoed/skosprovider_sqlalchemy/blob/master/HISTORY.rst" +Tracker = "https://github.com/OnroerendErfgoed/skosprovider_sqlalchemy/issues" +Source = "https://github.com/OnroerendErfgoed/skosprovider_sqlalchemy" +Documentation = "https://skosprovider_sqlalchemy.readthedocs.io/en/latest/" + +[project.optional-dependencies] +dev = [ + "uv==0.4.11", + "psycopg2-binary==2.9.9", + "sphinx==8.0.2", + "pytest==8.3.3", + "pytest-cov==5.0.0", + "coveralls==4.0.1", + "flake8==7.1.1", +] + +[project.scripts] +init_skos_db = "skosprovider_sqlalchemy.scripts.init_skos_db:main" +calc_visitation = "skosprovider_sqlalchemy.scripts.calc_visitation:main" + +## +# Build tool specific +## +[tool.hatch.build.targets.wheel] +# In the wheel we want to have skosprovider_sqlalchemy in the root as python module. +only-include = [ + "/skosprovider_sqlalchemy", +] + +[tool.hatch.metadata] +# This allows us to use github links as dependencies +allow-direct-references = true + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/x-rst" +fragments = [ + { path = "README.rst" }, + { path = "HISTORY.rst" }, +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 922b798..e7c9fc3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,16 +1,102 @@ -# Runtime requirements ---requirement requirements.txt - -# Postgresql database access -psycopg2==2.9.5 - -# Documentation -Sphinx==6.0.0 - -# Testing -pytest==7.2.0 -pytest-cov==4.0.0 -coveralls==3.3.1 - -# Linting -flake8==6.0.0 +alabaster==1.0.0 + # via sphinx +babel==2.16.0 + # via sphinx +cachetools==5.5.0 + # via pyld +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +coverage==7.6.1 + # via + # coveralls + # pytest-cov +coveralls==4.0.1 + # via skosprovider-sqlalchemy (pyproject.toml) +docopt==0.6.2 + # via coveralls +docutils==0.21.2 + # via sphinx +flake8==7.1.1 + # via skosprovider-sqlalchemy (pyproject.toml) +frozendict==2.4.4 + # via pyld +greenlet==3.1.0 + # via sqlalchemy +html5lib==1.1 + # via skosprovider +idna==3.10 + # via requests +imagesize==1.4.1 + # via sphinx +iniconfig==2.0.0 + # via pytest +jinja2==3.1.4 + # via sphinx +language-tags==1.2.0 + # via skosprovider +lxml==5.3.0 + # via pyld +markupsafe==2.1.5 + # via jinja2 +mccabe==0.7.0 + # via flake8 +packaging==24.1 + # via + # pytest + # sphinx +pluggy==1.5.0 + # via pytest +psycopg2-binary==2.9.9 + # via skosprovider-sqlalchemy (pyproject.toml) +pycodestyle==2.12.1 + # via flake8 +pyflakes==3.2.0 + # via flake8 +pygments==2.18.0 + # via sphinx +pyld==2.0.4 + # via skosprovider +pytest==8.3.3 + # via + # skosprovider-sqlalchemy (pyproject.toml) + # pytest-cov +pytest-cov==5.0.0 + # via skosprovider-sqlalchemy (pyproject.toml) +requests==2.32.3 + # via + # coveralls + # sphinx +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via html5lib +skosprovider==1.2.0 + # via skosprovider-sqlalchemy (pyproject.toml) +snowballstemmer==2.2.0 + # via sphinx +sphinx==8.0.2 + # via skosprovider-sqlalchemy (pyproject.toml) +sphinxcontrib-applehelp==2.0.0 + # via sphinx +sphinxcontrib-devhelp==2.0.0 + # via sphinx +sphinxcontrib-htmlhelp==2.1.0 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-qthelp==2.0.0 + # via sphinx +sphinxcontrib-serializinghtml==2.0.0 + # via sphinx +sqlalchemy==2.0.35 + # via skosprovider-sqlalchemy (pyproject.toml) +typing-extensions==4.12.2 + # via sqlalchemy +urllib3==2.2.3 + # via requests +uv==0.4.11 + # via skosprovider-sqlalchemy (pyproject.toml) +webencodings==0.5.1 + # via html5lib diff --git a/requirements.txt b/requirements.txt index e274081..37ff42d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,26 @@ -SQLAlchemy==1.4.47 +cachetools==5.5.0 + # via pyld +frozendict==2.4.4 + # via pyld +greenlet==3.1.0 + # via sqlalchemy +html5lib==1.1 + # via skosprovider +language-tags==1.2.0 + # via skosprovider +lxml==5.3.0 + # via pyld +pyld==2.0.4 + # via skosprovider +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via html5lib skosprovider==1.2.0 + # via skosprovider-sqlalchemy (pyproject.toml) +sqlalchemy==2.0.35 + # via skosprovider-sqlalchemy (pyproject.toml) +typing-extensions==4.12.2 + # via sqlalchemy +webencodings==0.5.1 + # via html5lib diff --git a/setup.py b/setup.py deleted file mode 100755 index f1e0771..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -packages = [ - 'skosprovider_sqlalchemy', -] - -requires = [ - 'skosprovider>=1.2.0', - 'sqlalchemy', -] - -setup( - name='skosprovider_sqlalchemy', - version='2.1.1', - description='A sqlAlchemy implementation of skosprovider.', - long_description=open('README.rst').read(), - long_description_content_type='text/x-rst', - author='Koen Van Daele', - author_email='koen_van_daele@telenet.be', - url='https://github.com/OnroerendErfgoed/skosprovider_sqlalchemy', - packages=packages, - package_data={'': ['LICENSE']}, - package_dir={'skosprovider_sqlalchemy': 'skosprovider_sqlalchemy'}, - include_package_data=True, - install_requires=requires, - license='MIT', - zip_safe=False, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - ], - entry_points="""\ - [console_scripts] - init_skos_db = skosprovider_sqlalchemy.scripts.init_skos_db:main - calc_visitation = skosprovider_sqlalchemy.scripts.calc_visitation:main - """, -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 4735085..0000000 --- a/tox.ini +++ /dev/null @@ -1,16 +0,0 @@ -[tox] -envlist = py38, py39, py310, py311, cover - -[testenv] -commands = - pip install -r requirements-dev.txt - python setup.py develop - py.test tests - -[testenv:cover] -basepython = - python3.8 -commands = - pip install -r requirements-dev.txt - python setup.py develop - py.test --cov skosprovider_sqlalchemy --cov-report term-missing tests