From f5b2ae8ab27cec3c241e801548186704d96e5748 Mon Sep 17 00:00:00 2001 From: Tim Van Campenhout Date: Mon, 23 Sep 2024 15:14:09 +0200 Subject: [PATCH 1/2] #134 gh actions pyproj --- .../workflows/skosprovider_atramhasis.yaml | 38 +++++++++ .travis.yml | 13 --- docs/Makefile | 8 +- docs/make.bat | 4 +- pyproject.toml | 65 +++++++++++++++ requirements-dev.txt | 81 ++++++++++++++++--- requirements.txt | 40 ++++++++- setup.cfg | 2 - setup.py | 41 ---------- tox.ini | 21 ----- 10 files changed, 215 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/skosprovider_atramhasis.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_atramhasis.yaml b/.github/workflows/skosprovider_atramhasis.yaml new file mode 100644 index 0000000..bf72ec0 --- /dev/null +++ b/.github/workflows/skosprovider_atramhasis.yaml @@ -0,0 +1,38 @@ +name: skosprovider_atramhasis backend tests +on: + push: + paths: + - skosprovider_atramhasis/** + - tests/** + - skosprovider_atramhasis.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 0b7c188..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -python: -- 3.6 -- 3.7 -- 3.8 -install: -- pip install -U setuptools -- pip install -r requirements-dev.txt #fix versions -- python setup.py develop -script: -- py.test --cov skosprovider_atramhasis --cov-report term-missing tests -after_success: -- coveralls diff --git a/docs/Makefile b/docs/Makefile index ec4d8d7..bede492 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -85,17 +85,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/skosprovider_getty.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/skosprovider_atramhasis.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/skosprovider_getty.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/skosprovider_atramhasis.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/skosprovider_getty" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/skosprovider_getty" + @echo "# mkdir -p $$HOME/.local/share/devhelp/skosprovider_atramhasis" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/skosprovider_atramhasis" @echo "# devhelp" epub: diff --git a/docs/make.bat b/docs/make.bat index b084572..81fc0e5 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -115,9 +115,9 @@ if "%1" == "qthelp" ( echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\skosprovider_getty.qhcp + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\skosprovider_atramhasis.qhcp echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\skosprovider_getty.ghc + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\skosprovider_atramhasis.ghc goto end ) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e929f76 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[project] +version = "1.0.0" +name = "skosprovider_atramhasis" +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.1.0", + "dogpile.cache==1.1.4", +] + +[project.urls] +History = "https://github.com/OnroerendErfgoed/skosprovider_atramhasis/blob/master/CHANGES.rst" +Tracker = "https://github.com/OnroerendErfgoed/skosprovider_atramhasis/issues" +Source = "https://github.com/OnroerendErfgoed/skosprovider_atramhasis" +Documentation = "https://skosprovider-atramhasis.readthedocs.io/en/latest/" + +[project.optional-dependencies] +dev = [ + "uv==0.4.1", + "pytest==8.3.3", + "responses==0.25.3", + "pytest-cov==5.0.0", + "coveralls==4.0.1", +] + +## +# Build tool specific +## +[tool.hatch.build.targets.wheel] +# In the wheel we want to have skosprovider_atramhasis in the root as python module. +only-include = [ + "/skosprovider_atramhasis", +] + +[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 1fad79d..5289a98 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,12 +1,69 @@ -# Runtime requirements ---requirement requirements.txt - -# Documentation -Sphinx==4.3.1 - -# Unit testing -tox==3.24.4 -pytest==6.2.5 -responses==0.16.0 -pytest-cov==3.0.0 -coveralls==3.3.1 +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-atramhasis (pyproject.toml) +decorator==5.1.1 + # via dogpile-cache +docopt==0.6.2 + # via coveralls +dogpile-cache==1.1.4 + # via skosprovider-atramhasis (pyproject.toml) +frozendict==2.4.4 + # via pyld +html5lib==1.1 + # via skosprovider +idna==3.10 + # via requests +iniconfig==2.0.0 + # via pytest +language-tags==1.2.0 + # via skosprovider +lxml==5.3.0 + # via pyld +packaging==24.1 + # via pytest +pbr==6.1.0 + # via stevedore +pluggy==1.5.0 + # via pytest +pyld==2.0.4 + # via skosprovider +pytest==8.3.3 + # via + # skosprovider-atramhasis (pyproject.toml) + # pytest-cov +pytest-cov==5.0.0 + # via skosprovider-atramhasis (pyproject.toml) +pyyaml==6.0.2 + # via responses +requests==2.32.3 + # via + # skosprovider-atramhasis (pyproject.toml) + # coveralls + # responses +responses==0.25.3 + # via skosprovider-atramhasis (pyproject.toml) +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via html5lib +skosprovider==1.1.0 + # via skosprovider-atramhasis (pyproject.toml) +stevedore==5.3.0 + # via dogpile-cache +urllib3==2.2.3 + # via + # requests + # responses +uv==0.4.1 + # via skosprovider-atramhasis (pyproject.toml) +webencodings==0.5.1 + # via html5lib diff --git a/requirements.txt b/requirements.txt index aa6fdfe..25fa7fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,38 @@ -requests==2.26.0 +cachetools==5.5.0 + # via pyld +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +decorator==5.1.1 + # via dogpile-cache +dogpile-cache==1.1.4 + # via skosprovider-atramhasis (pyproject.toml) +frozendict==2.4.4 + # via pyld +html5lib==1.1 + # via skosprovider +idna==3.10 + # via requests +language-tags==1.2.0 + # via skosprovider +lxml==5.3.0 + # via pyld +pbr==6.1.0 + # via stevedore +pyld==2.0.4 + # via skosprovider +requests==2.32.3 + # via skosprovider-atramhasis (pyproject.toml) +rfc3987==1.3.8 + # via skosprovider +six==1.16.0 + # via html5lib skosprovider==1.1.0 -# -e git+https://github.com/koenedaele/skosprovider.git@DEV_0.7.0#egg=skosprovider -dogpile.cache==1.1.4 + # via skosprovider-atramhasis (pyproject.toml) +stevedore==5.3.0 + # via dogpile-cache +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 2bef144..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +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() - -packages = [ - 'skosprovider_atramhasis' -] - -requires = [ - 'skosprovider>=0.7.1', - 'requests', - 'dogpile.cache>=1.1.0', -] -setup( - name='skosprovider_atramhasis', - version='1.0.0', - description='Skosprovider implementation of Atramhasis Vocabularies', - long_description=README, - 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.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], - author='Flanders Heritage Agency', - author_email='ict@onroerenderfgoed.be', - url='https://github.com/OnroerendErfgoed/skosprovider_atramhasis', - keywords='atramhasis skos skosprovider thesauri vocabularies', -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 80ef64d..0000000 --- a/tox.ini +++ /dev/null @@ -1,21 +0,0 @@ -[tox] -envlist = py36, py37, py38, 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_atramhasis --cov-report term-missing tests -deps = - pytest - pytest-cov From 41be96cadda5bd20ac9f4c4227d11336a6682830 Mon Sep 17 00:00:00 2001 From: Tim Van Campenhout Date: Mon, 23 Sep 2024 15:20:32 +0200 Subject: [PATCH 2/2] #134 gh actions pyproj --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e929f76..42b400c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ { name = "Flanders Heritage Agency", email = "ict@onroerenderfgoed.be" }, ] license = "MIT" -description = "Skosprovider implementation of the Getty Vocabularies" +description = "Skosprovider implementation of Atramhasis Vocabularies" requires-python = ">=3.10,<3.13" keywords = ["rdf", "skos", "skosprovider", "vocabularies", "thesauri"] classifiers = [