diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5bafd8e..5c29407 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,17 +6,18 @@ jobs: strategy: matrix: - python: ["2.7", "3.6", "3.7", "3.8"] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] name: Test Python ${{ matrix.python }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + allow-prereleases: true - name: Install dependencies run: | @@ -32,14 +33,14 @@ jobs: needs: [ test ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.12 - name: Install wheel run: python -m pip install wheel --user diff --git a/changes.rst b/changes.rst index 5765016..00a3d6b 100644 --- a/changes.rst +++ b/changes.rst @@ -1,6 +1,17 @@ translationstring ================= +2.0 (unreleased) +---------------- + +- Add support for Python 3.8 - 3.13. + +- Drop support for Python 2.7 and Python 3 < 3.8 (this release now adds + ``python_requires='>=3.8'``, so that older Python versions won't install + it. + +- Remove ``translationstring.compat`` module. + 1.4 (2020-07-09) ---------------- diff --git a/docs/conf.py b/docs/conf.py index 65546ff..1a2f4c8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ # out serve to show the default value. import sys, os, datetime -import pkg_resources +from importlib import metadata import pylons_sphinx_themes # General configuration @@ -41,7 +41,7 @@ # other places throughout the built documents. # # The short X.Y version. -version = pkg_resources.get_distribution('translationstring').version +version = metadata.version('translationstring') # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/glossary.rst b/docs/glossary.rst index ac20bfa..e392c57 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -21,12 +21,16 @@ Glossary predefines a :term:`translation domain`. Translation Domain - A string representing the "context" in which a particular - translation was made. For example the word "java" might be - translated differently if the translation domain is - "programming-languages" than would be if the translation domain - was "coffee". Every :term:`translation string` has an associated - translation domain. + A string representing the "domain" in which a particular + translation was made. Normally represents the project / package name + that defines the term. Every :term:`translation string` has an + associated translation domain. + + Translation Context + An optional string added to help resolve translation ambiguities + associated with very short terms, such as those which appear in + GUI menus, etc. See: + https://www.gnu.org/software/gettext/manual/gettext.html#Contexts Message Identifier An unchanging string that is the identifier for a particular diff --git a/setup.py b/setup.py index 2ba5ec0..2c9d9b3 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,12 @@ 'pylons-sphinx-themes', ] +testing_extras = [ + 'pytest', + 'pytest-cov', + 'coverage' +] + setup( name='translationstring', version='1.4dev', @@ -27,12 +33,13 @@ classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", @@ -40,6 +47,7 @@ "Topic :: Software Development :: Localization", "License :: Repoze Public License", ], + python_requires='>=3.8', keywords='i18n l10n internationalization localization gettext chameleon', author="Chris McDonough, Agendaless Consulting", author_email="pylons-discuss@googlegroups.com", @@ -50,6 +58,8 @@ zip_safe=False, test_suite="translationstring", extras_require={ + 'test': testing_extras, + 'testing': testing_extras, 'docs': docs_extras, }, ) diff --git a/tox.ini b/tox.ini index fcd499c..c40fbc2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,27 +1,26 @@ [tox] envlist = - py27,py33,py34,py35,pypy,cover,docs + py38,py39,py310,py311,py312,py313,pypy3,cover,docs [testenv] commands = - python setup.py test -q + pytest deps = + pytest Babel [testenv:cover] basepython = - python2.7 + python3.12 commands = - python setup.py nosetests --with-xunit --with-xcoverage + pytest --cov=translationstring deps = Babel - nose - coverage==3.4 - nosexcover + pytest-cov [testenv:docs] basepython = - python2.7 + python3.12 commands = pip install translationstring[docs] sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html diff --git a/translationstring/__init__.py b/translationstring/__init__.py index b1a9a95..40c420b 100644 --- a/translationstring/__init__.py +++ b/translationstring/__init__.py @@ -1,17 +1,14 @@ import re from gettext import NullTranslations -from translationstring.compat import text_type -from translationstring.compat import string_types -from translationstring.compat import PY3 NAME_RE = r"[a-zA-Z][-a-zA-Z0-9_]*" _interp_regex = re.compile(r'(?