diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 00183b0..a6ff77c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,24 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + with: + fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.13' - architecture: 'x64' + python-version: '3.x' - - name: Install dependencies and package + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install ".[build]" - name: Build source and binary distribution package run: | - python setup.py sdist bdist_wheel - env: - PACKAGE_VERSION: ${{ github.ref }} + python -m build - name: Check distribution package run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f277ad3..2cd04b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,40 +2,39 @@ name: Run linter and tests on: [push, pull_request] jobs: - test: + build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" + - '3.10' + - '3.11' + - '3.12' + - '3.13' + - '3.14' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies and package - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + - name: Install dependencies and package + run: | + python -m pip install --upgrade pip + pip install -e ".[test,dev]" - - name: Run linters and format checks - run: | - pre-commit run --all-files + - name: Run lint and code review + run: | + pre-commit run --all-files - - name: Run tests - run: | - # run tests with coverage - coverage run --source='./deepcompare' -m pytest - coverage xml + - name: Run tests with coverage + run: | + coverage run --source='./deepcompare' -m pytest + coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 diff --git a/.gitignore b/.gitignore index 0904884..a9cba74 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ coverage.xml *.egg-info *.pyc *.pyo +*.sqlite* +build/ +dist/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ce655d..ff4f1b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer @@ -9,18 +9,18 @@ repos: args: ["--markdown-linebreak-ext=md"] - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.21.2 hooks: - id: pyupgrade - args: ["--py39-plus"] + args: ["--py310-plus"] - repo: https://github.com/asottile/add-trailing-comma - rev: v3.1.0 + rev: v4.0.0 hooks: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.14.14 hooks: - id: ruff args: [ --fix ] diff --git a/LICENSE b/LICENSE index 1e7f292..30fccbf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 ANEXIA Internetdienstleisungs GmbH +Copyright (c) 2021-2026 Anexia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..5949fc2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +Please report any security issues you discovered to opensource[at]anexia-it[dot]com + +We will assess the risk, plus make a fix available before we create a GitHub issue. + +Thank you for your contribution. diff --git a/pyproject.toml b/pyproject.toml index 9ceb7d2..9779468 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,51 @@ [build-system] -requires = [ - "setuptools>=75", - "wheel", -] +requires = ["setuptools>=75", "wheel", "setuptools_scm[toml]>=8"] build-backend = "setuptools.build_meta" + +[project] +name = "python-deepcompare" +dynamic = ["version"] +description = "A library for deep comparison of data structures consisting of dict, list and tuple." +readme = "README.md" +requires-python = ">=3.10" +license = {file = "LICENSE"} +authors = [{name = "Anexia", email = "opensource@anexia-it.com"}] +urls = {Homepage = "https://github.com/anexia/python-deepcompare"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "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", +] +dependencies = [ +] + +[project.optional-dependencies] +test = [ + "coverage>=7.13.2", + "pytest>=8", +] +dev = [ + "pre-commit>=4.5,<4.6", +] +build = [ + "build>=1.4.0", + "twine>=6.2.0", + "wheel>=0.46.3", +] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["."] +include = ["deepcompare*"] + +[tool.setuptools_scm] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a18b468..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Package and package dependencies --e . - -# Development dependencies -codecov>=2.1,<2.2 -pre-commit>=4.0.1,<4.2 -pytest>=8.3,<8.4 -setuptools>=75 -twine>=5.1 -wheel>=0.44 diff --git a/setup.py b/setup.py deleted file mode 100644 index 52884b6..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -import os - -from setuptools import find_packages, setup - -with open(os.path.join(os.path.dirname(__file__), "README.md")) as fh: - readme = fh.read() - -# allow setup.py to be run from any path -os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) - -setup( - name="python-deepcompare", - version=os.getenv("PACKAGE_VERSION", "0.0.0").replace("refs/tags/", ""), - packages=find_packages(), - include_package_data=True, - license="MIT", - description="A library for deep comparison of data structures consisting of `dict`, `list` and `tuple`.", - long_description=readme, - long_description_content_type="text/markdown", - url="https://github.com/anexia/python-deepcompare", - author="Andreas Stocker", - author_email="AStocker@anexia-it.com", - install_requires=[], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "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", - "Topic :: Software Development", - ], -) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29