Skip to content

Commit

Permalink
Merge pull request #146 from roskakori/145-add-python-3.12
Browse files Browse the repository at this point in the history
#145 Add python 3.12
  • Loading branch information
roskakori committed May 12, 2024
2 parents 23181db + 0b41a14 commit d671461
Show file tree
Hide file tree
Showing 22 changed files with 648 additions and 568 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
env:
MAIN_PYTHON_VERSION: "3.10" # same as Ubuntu 22 LTS
MAIN_PYTHON_VERSION: "3.12" # same as Ubuntu 24 LTS

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -39,12 +39,12 @@ jobs:
- name: Run the test suite
run: |
poetry run pytest --cov=pygount --cov-branch
- name: Update coveralls
if: ${{ matrix.python-version }} == $MAIN_PYTHON_VERSION
- name: Build documentation
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: |
poetry run sh scripts/build_documentation.sh
- name: Update coveralls
if: ${{ matrix.python-version }} == $MAIN_PYTHON_VERSION
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ repos:
- id: isort

- repo: https://github.com/ambv/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.1.0
hooks:
- id: prettier

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: fix-byte-order-marker
- id: trailing-whitespace
Expand All @@ -32,13 +32,13 @@ repos:
- id: debug-statements

- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: ["pep8-naming==0.13.3"]
5 changes: 5 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Changes

This chapter describes the changes coming with each new version of pygount.

Version 1.7.0, 2023-07-02

* Add Python 3.12 and made it the main version for CI (issue
`#145 <https://github.com/roskakori/pygount/issues/145>`_).

Version 1.6.1, 2023-07-02

* Fixed missing check for seekable file handles (issue
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sphinx==7.0.1
Sphinx==7.3.7
1,153 changes: 605 additions & 548 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pygount/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Pygount counts lines of source code using pygments lexers.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
from importlib.metadata import version
Expand Down
1 change: 1 addition & 0 deletions pygount/analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions to analyze source code and count lines in it.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import codecs
Expand Down
1 change: 1 addition & 0 deletions pygount/command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Command line interface for pygount.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import argparse
Expand Down
1 change: 1 addition & 0 deletions pygount/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common classes and functions for pygount.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import fnmatch
Expand Down
1 change: 1 addition & 0 deletions pygount/lexers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Additional lexers for pygount that fill gaps left by :py:mod:`pygments`.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import pygments.lexer
Expand Down
1 change: 1 addition & 0 deletions pygount/summary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Summaries of analyses of multiple source codes.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import functools
Expand Down
1 change: 1 addition & 0 deletions pygount/write.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Writers to store the results of a pygount analysis.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import datetime
Expand Down
1 change: 1 addition & 0 deletions pygount/xmldialect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Function to obtain the language dialect used by XML source code.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import logging
Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target-version = [
"py39",
"py310",
"py311",
"py312",
]
exclude = '''
/(
Expand Down Expand Up @@ -33,7 +34,7 @@ testpaths = [

[tool.poetry]
name = "pygount"
version = "1.6.1"
version = "1.7.0"
description = "count source lines of code (SLOC) using pygments"
readme = "README.md"
authors = ["Thomas Aglassinger <roskakori@users.sourceforge.net>"]
Expand All @@ -54,27 +55,28 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
]
packages = [
{ include = "pygount" },
]

[tool.poetry.dependencies]
python = ">=3.8, <4"
python = ">=3.8, <3.13" # NOTE We cannot use <4 because of coveralls.
pygments = "^2"
chardet = "^5"
rich = ">=9, <14"
gitpython = "^3.1.31"
gitpython = "^3"

[tool.poetry.dev-dependencies]
coveralls = "^3"
coverage = "^6"
pytest = "^7"
pytest-cov = "^4"
coveralls = "^4"
coverage = "^7"
pytest = "^8"
pytest-cov = "^5"
pre-commit = "^3"
pur = "^7"
twine = "^4"
twine = "^5"

[tool.poetry.group.docs]
optional = true
Expand All @@ -93,5 +95,5 @@ pygount = "pygount.command:main"
max-line-length = 120

[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.8.1"]
build-backend = "poetry.core.masonry.api"
1 change: 1 addition & 0 deletions tests/_common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common constants and functions used by multiple tests.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import os
Expand Down
1 change: 1 addition & 0 deletions tests/test_analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for pygount source code analysis.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import glob
Expand Down
1 change: 1 addition & 0 deletions tests/test_command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for pygount command line interface.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import json
Expand Down
1 change: 1 addition & 0 deletions tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for :py:mod:`pygount.common` module.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import re
Expand Down
1 change: 1 addition & 0 deletions tests/test_lexers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for additional lexers for pygount.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.

Expand Down
1 change: 1 addition & 0 deletions tests/test_summary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests to summarize analyses of multiple source codes.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
from pygount.analysis import SourceAnalysis, SourceState
Expand Down
1 change: 1 addition & 0 deletions tests/test_write.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test to write results of pygount analyses.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import io
Expand Down
1 change: 1 addition & 0 deletions tests/test_xmldialect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for function to obtain the language dialect used by XML source code.
"""

# Copyright (c) 2016-2023, Thomas Aglassinger.
# All rights reserved. Distributed under the BSD License.
import pygount.xmldialect
Expand Down

0 comments on commit d671461

Please sign in to comment.