Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: ["3.10", 3.11, 3.12, 3.13, 3.14]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
5 changes: 5 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ tox -r
flake8 src
```

- Make sure pylint report a score of 10:
```shell
pylint src
```

- Update the version number, by removing the trailing `.dev0` in:
- `setup.cfg`
- `src/pyconcepticon/__init__.py`
Expand Down
15 changes: 7 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ classifiers =
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python :: 3
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 :: 3.14
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
License :: OSI Approved :: Apache Software License
Expand All @@ -37,18 +37,17 @@ zip_safe = False
packages = find:
package_dir =
= src
python_requires = >=3.8
python_requires = >=3.9
install_requires =
setuptools
attrs>=18.1.0
pybtex>=0.22.2
csvw>=3
clldutils>=3.4
simplepybtex
csvw>=4
clldutils>=4
cldfcatalog>=1.3
cdstarcat
nameparser
termcolor
tabulate
backports.strenum; python_version < '3.11'
include_package_data = True

[options.packages.find]
Expand Down Expand Up @@ -95,7 +94,7 @@ show_missing = true
skip_covered = true

[tox:tox]
envlist = py38, py39, py310, py311, py312, py313
envlist = py39, py310, py311, py312, py313, py314
isolated_build = true
skip_missing_interpreter = true

Expand Down
3 changes: 3 additions & 0 deletions src/pyconcepticon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Functionality to access and curate the Concepticon dataset.
"""
# noqa
from pyconcepticon.api import Concepticon # noqa: F401

Expand Down
15 changes: 12 additions & 3 deletions src/pyconcepticon/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
concepticon [OPTIONS] <command> [args]

"""
import logging
import sys
import pathlib
import argparse
import contextlib
from typing import Optional
from collections.abc import Sequence

from clldutils.clilib import register_subcommands, get_parser_and_subparsers, ParserError
from clldutils.loglib import Logging
Expand All @@ -23,7 +27,12 @@
import pyconcepticon.commands


def main(args=None, catch_all=False, parsed_args=None, log=None):
def main( # pylint: disable=C0116
args: Optional[Sequence[str]] = None,
catch_all: bool = False,
parsed_args: Optional[argparse.Namespace] = None,
log: Optional[logging.Logger] = None,
) -> Optional[int]:
repos = None
try:
repos = cldfcatalog.Config.from_file().get_clone('concepticon')
Expand Down Expand Up @@ -58,14 +67,14 @@ def main(args=None, catch_all=False, parsed_args=None, log=None):
# use of a Catalog as context manager:
stack.enter_context(cldfcatalog.Catalog(args.repos, tag=args.repos_version))
args.repos = Concepticon(args.repos)
args.log.info('concepticon/concepticon-data at {0}'.format(args.repos.repos))
args.log.info(f'concepticon/concepticon-data at {args.repos.repos}')
try:
return args.main(args) or 0
except KeyboardInterrupt: # pragma: no cover
return 0
except ParserError as e:
print(e)
return main([args._command, '-h'])
return main([args._command, '-h']) # pylint: disable=W0212
except Exception as e: # pragma: no cover
if catch_all:
print(e)
Expand Down
10 changes: 10 additions & 0 deletions src/pyconcepticon/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
Compat with older python versions.
"""
import sys

if sys.version_info >= (3, 11):
from enum import StrEnum
assert StrEnum
else:
from backports.strenum import StrEnum # pragma: no cover
Loading