diff --git a/.github/workflows/language-tags.yaml b/.github/workflows/language-tags.yaml new file mode 100644 index 0000000..f26da6d --- /dev/null +++ b/.github/workflows/language-tags.yaml @@ -0,0 +1,38 @@ +name: language-tags backend tests +on: + push: + paths: + - language-tags/** + - tests/** + - language-tags.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 5210b02..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -dist: focal -language: python -python: - - 3.8 - - 3.9 - - 3.10 -install: - - pip install pytest coveralls pytest-cov - - python setup.py develop -script: - py.test --cov language_tags --cov-report term-missing tests -after_success: - coveralls diff --git a/docs/source/conf.py b/docs/source/conf.py index 63392a3..8826e3f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # language_tags documentation build configuration file, created by # sphinx-quickstart on Mon Sep 8 10:24:40 2014. diff --git a/language_tags/Subtag.py b/language_tags/Subtag.py index d39e613..d755cbd 100644 --- a/language_tags/Subtag.py +++ b/language_tags/Subtag.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import json from language_tags import data diff --git a/language_tags/Tag.py b/language_tags/Tag.py index 09c3d44..20e8e99 100644 --- a/language_tags/Tag.py +++ b/language_tags/Tag.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import json diff --git a/language_tags/tags.py b/language_tags/tags.py index afeafca..4f3a217 100644 --- a/language_tags/tags.py +++ b/language_tags/tags.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from language_tags.Subtag import Subtag from language_tags.Tag import Tag from language_tags import data diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9ca3c2d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[project] +version = "1.2.0" +name = "language-tags" +dynamic = ["readme"] +authors = [ + { name = "Flanders Heritage Agency", email = "ict@onroerenderfgoed.be" }, +] +license = "MIT" +description = "This project is a Python version of the language-tags Javascript project." +requires-python = ">=3.10,<3.13" +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 = [ +] + +[project.urls] +History = "https://github.com/OnroerendErfgoed/language-tags/blob/master/HISTORY.rst" +Tracker = "https://github.com/OnroerendErfgoed/language-tags/issues" +Source = "https://github.com/OnroerendErfgoed/language-tags" +Documentation = "https://language-tags.readthedocs.io/en/latest/" + +[project.optional-dependencies] +dev = [ + "uv==0.4.1", + "sphinx==6.1.2", + "pytest==8.3.3", + "pytest-cov==5.0.0", +] + +## +# Build tool specific +## +[tool.hatch.build.targets.wheel] +# In the wheel we want to have language-tags in the root as python module. +only-include = [ + "/language-tags", +] + +[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 977dcdf..72e56cd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,58 @@ -# Runtime requirements ---requirement requirements.txt - -# Testing -pytest==7.2.0 -pytest-cov==4.0.0 - -# Documentation -Sphinx==6.1.2 \ No newline at end of file +alabaster==0.7.16 + # via sphinx +babel==2.16.0 + # via sphinx +certifi==2024.8.30 + # via requests +charset-normalizer==3.3.2 + # via requests +coverage==7.6.1 + # via pytest-cov +docutils==0.19 + # via sphinx +idna==3.10 + # via requests +imagesize==1.4.1 + # via sphinx +iniconfig==2.0.0 + # via pytest +jinja2==3.1.4 + # via sphinx +markupsafe==2.1.5 + # via jinja2 +packaging==24.1 + # via + # pytest + # sphinx +pluggy==1.5.0 + # via pytest +pygments==2.18.0 + # via sphinx +pytest==8.3.3 + # via + # language-tags (pyproject.toml) + # pytest-cov +pytest-cov==5.0.0 + # via language-tags (pyproject.toml) +requests==2.32.3 + # via sphinx +snowballstemmer==2.2.0 + # via sphinx +sphinx==6.1.2 + # via language-tags (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 language-tags (pyproject.toml) diff --git a/setup.py b/setup.py index d1153ca..41c84c2 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- #!/usr/bin/env python try: from setuptools import setup diff --git a/tests/test_Subtag.py b/tests/test_Subtag.py index ac3064b..3af9270 100644 --- a/tests/test_Subtag.py +++ b/tests/test_Subtag.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import unittest from language_tags.Subtag import Subtag diff --git a/tests/test_Tag.py b/tests/test_Tag.py index 75dc1e4..a95bdd7 100644 --- a/tests/test_Tag.py +++ b/tests/test_Tag.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import unittest from language_tags.Tag import Tag diff --git a/tests/test_tags.py b/tests/test_tags.py index 320b171..39b71bf 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import unittest import re