Skip to content

Commit

Permalink
Changes to use pyproject.toml and updated pylintrc to version 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Dec 28, 2023
1 parent c977f49 commit b9110f0
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 246 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential python3 python3-dev python3-distutils python3-setuptools
apt-get install -y build-essential python3 python3-dev python3-distutils python3-pip python3-setuptools python3-wheel
- name: Run tests
env:
LANG: en_US.UTF-8
Expand All @@ -69,6 +69,9 @@ jobs:
LANG: en_US.UTF-8
run: |
if test -f tests/end-to-end.py; then PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini; fi
- name: Update setuptools
run: |
python3 -m pip install -U setuptools
- name: Build source distribution
run: |
python3 ./setup.py sdist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
include:
- python-version: '3.8'
- python-version: '3.11'
toxenv: 'docs'
container:
image: ubuntu:22.04
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/test_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ jobs:
matrix:
include:
- python-version: '3.7'
toxenv: 'py37'
toxenv: 'py37,wheel'
- python-version: '3.8'
toxenv: 'py38'
toxenv: 'py38,wheel'
- python-version: '3.9'
toxenv: 'py39'
toxenv: 'py39,wheel'
- python-version: '3.10'
toxenv: 'py310'
toxenv: 'py310,wheel'
- python-version: '3.11'
toxenv: 'py311'
toxenv: 'py311,wheel'
- python-version: '3.12'
toxenv: 'py312,wheel'
container:
image: ubuntu:22.04
steps:
Expand Down Expand Up @@ -58,8 +60,8 @@ jobs:
strategy:
matrix:
include:
- python-version: '3.8'
toxenv: 'py38,coverage'
- python-version: '3.10'
toxenv: 'coverage'
container:
image: ubuntu:22.04
steps:
Expand Down
13 changes: 8 additions & 5 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pylint 2.17.x configuration file
# Pylint 3.0.x configuration file
#
# This file is generated by l2tdevtools update-dependencies.py, any dependency
# related changes should be made in dependencies.ini.
Expand Down Expand Up @@ -85,15 +85,14 @@ limit-inference-results=100

# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
# load-plugins=
load-plugins=pylint.extensions.docparams

# Pickle collected data for later comparisons.
persistent=yes

# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.11
py-version=3.12

# Discover python modules and packages in the file system subtree.
# recursive=no
Expand Down Expand Up @@ -441,6 +440,7 @@ confidence=HIGH,
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".

disable=assignment-from-none,
bad-inline-option,
consider-using-f-string,
Expand Down Expand Up @@ -468,6 +468,8 @@ disable=assignment-from-none,
too-many-return-statements,
too-many-statements,
unsubscriptable-object,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero,
useless-object-inheritance,
useless-suppression,
use-symbolic-message-instead
Expand Down Expand Up @@ -522,8 +524,9 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor
# used to format the message information. See doc for all details.
msg-template=

# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# Set the output format. Available formats are: text, parseable, colorized,
# json2 (improved json format), json (old json format) and msvs (visual
# studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
#output-format=

Expand Down
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py
fail_on_warning: false

python:
install:
- requirements: docs/requirements.txt
37 changes: 28 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,53 @@
environment:
matrix:
- DESCRIPTION: "Windows with 32-bit Python 3.11"
- DESCRIPTION: "Run tests on Windows with 32-bit Python 3.11"
MACHINE_TYPE: "x86"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PYTHON: "C:\\Python311"
PYTHON_VERSION: "3.11"
L2TBINARIES_TRACK: "dev"
- DESCRIPTION: "Windows with 64-bit Python 3.11"
TARGET: tests
- DESCRIPTION: "Run tests on Windows with 64-bit Python 3.11"
MACHINE_TYPE: "amd64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PYTHON: "C:\\Python311-x64"
PYTHON_VERSION: "3.11"
L2TBINARIES_TRACK: "dev"
- DESCRIPTION: "Mac OS with Python 3.11"
TARGET: tests
- DESCRIPTION: "Build wheel on Windows with 32-bit Python 3.11"
MACHINE_TYPE: "amd64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PYTHON: "C:\\Python311-x64"
PYTHON_VERSION: "3.11"
L2TBINARIES_TRACK: "dev"
TARGET: wheel
- DESCRIPTION: "Build wheel on Windows with 64-bit Python 3.11"
MACHINE_TYPE: "amd64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PYTHON: "C:\\Python311-x64"
PYTHON_VERSION: "3.11"
L2TBINARIES_TRACK: "dev"
TARGET: wheel
- DESCRIPTION: "Run tests on Mac OS with Python 3.11"
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
TARGET: tests

install:
- cmd: "%PYTHON%\\python.exe -m pip install -U pip setuptools twine wheel"
- cmd: "%PYTHON%\\python.exe -m pip install -U build pip setuptools twine wheel"
- ps: If ($isWindows) { .\config\appveyor\install.ps1 }
- sh: config/appveyor/install.sh

build_script:
- cmd: "%PYTHON%\\python.exe setup.py bdist_wheel"
- cmd: IF [%TARGET%]==[wheel] (
"%PYTHON%\\python.exe" -m build --wheel )

test_script:
- cmd: "%PYTHON%\\python.exe run_tests.py"
- cmd: IF EXIST "tests\\end-to-end.py" (
set PYTHONPATH=. &&
"%PYTHON%\\python.exe" "tests\\end-to-end.py" --debug -c "config\\end-to-end.ini" )
- cmd: IF [%TARGET%]==[tests] (
"%PYTHON%\\python.exe" run_tests.py &&
IF EXIST "tests\\end-to-end.py" (
set PYTHONPATH=. &&
"%PYTHON%\\python.exe" "tests\\end-to-end.py" --debug -c "config\\end-to-end.ini" ) )
- sh: config/appveyor/runtests.sh

artifacts:
Expand Down
2 changes: 1 addition & 1 deletion config/appveyor/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If ($Dependencies.Length -gt 0)

$env:PYTHONPATH = "..\l2tdevtools"

$Output = Invoke-Expression -Command "& '${env:PYTHON}\python.exe' ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type ${env:MACHINE_TYPE} ${env:L2TBINARIES_TRACK} ${Dependencies} 2>&1" | %{ "$_" }
$Output = Invoke-Expression -Command "& '${env:PYTHON}\python.exe' ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type ${env:MACHINE_TYPE} --track ${env:L2TBINARIES_TRACK} ${Dependencies} 2>&1" | %{ "$_" }
Write-Host (${Output} | Out-String)
}

1 change: 1 addition & 0 deletions dfkinds.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[project]
name: dfkinds
name_description: dfKinds
status: experimental
maintainer: Log2Timeline maintainers <[email protected]>
homepage_url: https://github.com/log2timeline/dfkinds
description_short: Digital Forensics kinds (types and classes).
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
certifi >= 2023.11.17
docutils
Markdown
recommonmark
sphinx >= 4.1.0, < 5.2.0
sphinx >= 4.1.0
sphinx-markdown-tables
sphinx-rtd-theme >= 0.5.1
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
pip >= 7.0.0
43 changes: 37 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
[metadata]
license_files = LICENSE
name = dfkinds
version = 20231228
description = Digital Forensics kinds (types and classes).
long_description = dfKinds, or Digital Forensics kinds, provides data type and class definitions to provide consistent definitions of entities (or description of things) across different tools.
long_description_content_type = text/plain
url = https://github.com/log2timeline/dfkinds
maintainer = Log2Timeline maintainers
maintainer_email = [email protected]
license = Apache License, Version 2.0
license_files =
ACKNOWLEDGEMENTS
AUTHORS
LICENSE
README
classifiers =
Development Status :: 2 - Pre-Alpha
Programming Language :: Python

[options]
install_requires = file:requirements.txt
package_dir =
dfkinds = dfkinds
packages = find:
python_requires = >=3.7

[options.packages.find]
exclude =
docs
tests
tests.*
utils
where = .

[bdist_rpm]
release = 1
packager = Log2Timeline maintainers <[email protected]>
doc_files = ACKNOWLEDGEMENTS
AUTHORS
LICENSE
README
doc_files =
ACKNOWLEDGEMENTS
AUTHORS
LICENSE
README
build_requires = python3-setuptools

[bdist_wheel]
universal = 1

Loading

0 comments on commit b9110f0

Please sign in to comment.