From af5f47e3ec1e2162aa663ab15f303988d3ff0e36 Mon Sep 17 00:00:00 2001 From: Tim Van Campenhout <45393594+vancamti@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:41:14 +0200 Subject: [PATCH] #104 #107 gh actions pyproj (#108) * #104 #107 gh actions pyproj * #104 #107 review fix --------- Co-authored-by: Tim Van Campenhout --- .github/workflows/skosprovider_getty.yaml | 38 ++++++++ .travis.yml | 15 ---- pyproject.toml | 65 ++++++++++++++ requirements-dev.txt | 105 +++++++++++++++++++--- requirements.txt | 39 +++++++- setup.cfg | 2 - setup.py | 43 --------- tox.ini | 21 ----- 8 files changed, 235 insertions(+), 93 deletions(-) create mode 100644 .github/workflows/skosprovider_getty.yaml delete mode 100644 .travis.yml create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tox.ini diff --git a/.github/workflows/skosprovider_getty.yaml b/.github/workflows/skosprovider_getty.yaml new file mode 100644 index 0000000..2198037 --- /dev/null +++ b/.github/workflows/skosprovider_getty.yaml @@ -0,0 +1,38 @@ +name: skosprovider_getty backend tests +on: + push: + paths: + - skosprovider_getty/** + - tests/** + - skosprovider_getty.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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 249b4de..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: python -os: linux -dist: focal -python: -- 3.9 -- 3.10 -- 3.11 -install: -- pip install -U setuptools -- pip install -r requirements-dev.txt #fix versions -- python setup.py develop -script: -- py.test --cov skosprovider_getty --cov-report term-missing tests -after_success: -- coveralls diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3591557 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[project] +version = "1.2.0" +name = "skosprovider_getty" +dynamic = ["readme"] +authors = [ + { name = "Flanders Heritage Agency", email = "ict@onroerenderfgoed.be" }, +] +license = "MIT" +description = "Skosprovider implementation of the Getty Vocabularies" +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 = [ + "requests==2.32.3", + "skosprovider==1.2.0", + "rdflib==6.3.2", +] + +[project.urls] +History = "https://github.com/OnroerendErfgoed/skosprovider_getty/blob/master/CHANGES.rst" +Tracker = "https://github.com/OnroerendErfgoed/skosprovider_getty/issues" +Source = "https://github.com/OnroerendErfgoed/skosprovider_getty" +Documentation = "https://skosprovider-getty.readthedocs.io/en/latest/" + +[project.optional-dependencies] +dev = [ + "uv==0.4.1", + "pytest==8.3.3", + "pytest-cov==5.0.0", + "coveralls==4.0.1", + "sphinx==8.0.2", +] + +## +# Build tool specific +## +[tool.hatch.build.targets.wheel] +# In the wheel we want to have skosprovider_getty in the root as python module. +only-include = [ + "/skosprovider_getty", +] + +[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 = "CHANGES.rst" }, +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 19d9e70..268034f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,95 @@ -# Runtime requirements ---requirement requirements.txt - -# Testing -pytest==6.2.5 -pytest-cov==3.0.0 -coveralls==3.3.1 - -# Documentation -Sphinx==4.3.0 \ No newline at end of file +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-getty (pyproject.toml) +docopt==0.6.2 + # via coveralls +docutils==0.21.2 + # via sphinx +frozendict==2.4.4 + # via pyld +html5lib==1.1 + # via skosprovider +idna==3.10 + # via requests +imagesize==1.4.1 + # via sphinx +iniconfig==2.0.0 + # via pytest +isodate==0.6.1 + # via rdflib +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 +packaging==24.1 + # via + # pytest + # sphinx +pluggy==1.5.0 + # via pytest +pygments==2.18.0 + # via sphinx +pyld==2.0.4 + # via skosprovider +pyparsing==3.1.4 + # via rdflib +pytest==8.3.3 + # via + # skosprovider-getty (pyproject.toml) + # pytest-cov +pytest-cov==5.0.0 + # via skosprovider-getty (pyproject.toml) +rdflib==6.3.2 + # via skosprovider-getty (pyproject.toml) +requests==2.32.3 + # via + # skosprovider-getty (pyproject.toml) + # coveralls + # sphinx +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via + # html5lib + # isodate +skosprovider==1.2.0 + # via skosprovider-getty (pyproject.toml) +snowballstemmer==2.2.0 + # via sphinx +sphinx==8.0.2 + # via skosprovider-getty (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 +urllib3==2.2.3 + # via requests +uv==0.4.1 + # via skosprovider-getty (pyproject.toml) +webencodings==0.5.1 + # via html5lib diff --git a/requirements.txt b/requirements.txt index de3d821..1bbe527 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,38 @@ -requests==2.31.0 -skosprovider==1.2.0 +cachetools==5.5.0 + # via pyld +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +frozendict==2.4.4 + # via pyld +html5lib==1.1 + # via skosprovider +idna==3.10 + # via requests +isodate==0.6.1 + # via rdflib +language-tags==1.2.0 + # via skosprovider +lxml==5.3.0 + # via pyld +pyld==2.0.4 + # via skosprovider +pyparsing==3.1.4 + # via rdflib rdflib==6.3.2 + # via skosprovider-getty (pyproject.toml) +requests==2.32.3 + # via skosprovider-getty (pyproject.toml) +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via + # html5lib + # isodate +skosprovider==1.2.0 + # via skosprovider-getty (pyproject.toml) +urllib3==2.2.3 + # via requests +webencodings==0.5.1 + # via html5lib diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3c6e79c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 42763dd..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -import os - -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) -README = open(os.path.join(here, 'README.rst')).read() -CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() - -packages = [ - 'skosprovider_getty' -] - -requires = [ - 'skosprovider>=1.1.0', - 'requests', - 'rdflib' -] - -setup( - name='skosprovider_getty', - version='1.2.0', - description='Skosprovider implementation of the Getty Vocabularies', - long_description=README + '\n\n' + CHANGES, - long_description_content_type='text/x-rst', - packages=packages, - include_package_data=True, - install_requires=requires, - license='MIT', - zip_safe=False, - classifiers=[ - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - ], - author='Flanders Heritage Agency', - author_email='ict@onroerenderfgoed.be', - url='https://github.com/OnroerendErfgoed/skosprovider_getty', - keywords='getty skos skosprovider vocabulary AAT TGN ULAN' -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index bff3d26..0000000 --- a/tox.ini +++ /dev/null @@ -1,21 +0,0 @@ -[tox] -envlist = py38, py39, py310, cover - -[testenv] -commands = - pip install -r requirements-dev.txt - python setup.py develop - py.test tests -deps = - pytest - -[testenv:cover] -basepython = - python3.6 -commands = - pip install -r requirements-dev.txt - python setup.py develop - py.test --cov skosprovider_getty --cov-report term-missing tests -deps = - pytest - pytest-cov