diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index 3d60ed3a..4ead18da 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -24,6 +24,8 @@ jobs: toxenv: 'py311,wheel' - python-version: '3.12' toxenv: 'py312,wheel' + - python-version: '3.13' + toxenv: 'py313,wheel' container: image: ubuntu:22.04 steps: diff --git a/.pylintrc b/.pylintrc index 877a22bf..33d61a71 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,4 +1,4 @@ -# Pylint 3.0.x configuration file +# Pylint 3.2.x configuration file # # This file is generated by l2tdevtools update-dependencies.py, any dependency # related changes should be made in dependencies.ini. @@ -29,6 +29,7 @@ clear-cache-post-run=no # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. +# extension-pkg-allow-list= extension-pkg-allow-list= # A comma-separated list of package or module names from where C extensions may @@ -63,10 +64,11 @@ ignore-paths= # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -85,11 +87,16 @@ 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 +# Resolve imports to .pyi stubs if available. May reduce no-member messages and +# increase not-an-iterable messages. +prefer-stubs=no + # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. py-version=3.12 @@ -440,7 +447,6 @@ 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, @@ -478,6 +484,7 @@ disable=assignment-from-none, # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. +# enable= enable=c-extension-no-member @@ -510,6 +517,11 @@ max-nested-blocks=5 # printed. never-returning-functions=sys.exit,argparse.parse_error +# Let 'consider-using-join' be raised when the separator to join on would be +# non-empty (resulting in expected fixes of the type: ``"- " + " - +# ".join(items)``) +suggest-join-with-non-empty-separator=yes + [REPORTS] diff --git a/appveyor.yml b/appveyor.yml index fa80fa7c..6ad3e37c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,8 +28,8 @@ environment: PYTHON_VERSION: "3.12" L2TBINARIES_TRACK: "dev" TARGET: wheel - - DESCRIPTION: "Run tests on Mac OS with Python 3.12" - APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey + - DESCRIPTION: "Run tests on Mac OS with Python 3.13" + APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma HOMEBREW_NO_INSTALL_CLEANUP: 1 TARGET: tests diff --git a/artifacts/reader.py b/artifacts/reader.py index 09467611..1bc944b1 100644 --- a/artifacts/reader.py +++ b/artifacts/reader.py @@ -237,8 +237,7 @@ def ReadDirectory(self, path, extension='yaml'): glob_spec = os.path.join(path, '*') for artifact_file in glob.glob(glob_spec): - for artifact_definition in self.ReadFile(artifact_file): - yield artifact_definition + yield from self.ReadFile(artifact_file) def ReadFile(self, filename): """Reads artifact definitions from a file. @@ -250,8 +249,7 @@ def ReadFile(self, filename): ArtifactDefinition: an artifact definition. """ with io.open(filename, 'r', encoding='utf-8') as file_object: - for artifact_definition in self.ReadFileObject(file_object): - yield artifact_definition + yield from self.ReadFileObject(file_object) @abc.abstractmethod def ReadFileObject(self, file_object): diff --git a/artifacts/scripts/validator.py b/artifacts/scripts/validator.py index de03bc2d..69850361 100755 --- a/artifacts/scripts/validator.py +++ b/artifacts/scripts/validator.py @@ -585,6 +585,8 @@ def Main(): validator = ArtifactDefinitionsValidator() + result = False + if os.path.isdir(options.definitions): print(f'Validating definitions in: {options.definitions:s}/*.yaml') result = validator.CheckDirectory(options.definitions) diff --git a/config/appveyor/install.sh b/config/appveyor/install.sh index 42c4ab6b..51eb76d4 100755 --- a/config/appveyor/install.sh +++ b/config/appveyor/install.sh @@ -3,5 +3,5 @@ set -e brew update -q -brew install -q gettext gnu-sed python@3.12 tox || true +brew install -q gettext gnu-sed python@3.13 tox || true diff --git a/config/appveyor/runtests.sh b/config/appveyor/runtests.sh index 86ba5ce1..18cc67c3 100755 --- a/config/appveyor/runtests.sh +++ b/config/appveyor/runtests.sh @@ -9,7 +9,7 @@ export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/gettext/lib ${LDFLAGS}"; export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include ${CPPFLAGS}"; export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib ${LDFLAGS}"; -# Set the following environment variables to ensure tox can find Python 3.12. -export PATH="/usr/local/opt/python@3.12/bin:${PATH}"; +# Set the following environment variables to ensure tox can find Python 3.13. +export PATH="/usr/local/opt/python@3.13/bin:${PATH}"; -tox -e py312 +tox -e py313 diff --git a/setup.cfg b/setup.cfg index a1dc4364..6075f367 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = artifacts -version = 20240518 +version = 20241226 description = ForensicArtifacts.com Artifact Repository. long_description = A free, community-sourced, machine-readable knowledge base of forensic artifacts that the world can use both as an information source and within other tools. long_description_content_type = text/plain @@ -40,6 +40,3 @@ where = . console_scripts = stats = artifacts.scripts.stats:Main validator = artifacts.scripts.validator:Main - -[bdist_wheel] -universal = 1 diff --git a/tox.ini b/tox.ini index cbf0d235..4b13a5d0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{8,9,10,11,12},coverage,docformatter,docs,lint,wheel +envlist = py3{8,9,10,11,12,13},coverage,docformatter,docs,lint,wheel [testenv] allowlist_externals = ./run_tests.py @@ -19,7 +19,7 @@ deps = setuptools >= 65 wheel commands = - py3{8,9,10,11,12}: ./run_tests.py + py3{8,9,10,11,12,13}: ./run_tests.py coverage: coverage erase coverage: coverage run --source=artifacts --omit="*_test*,*__init__*,*test_lib*" run_tests.py coverage: coverage xml @@ -53,7 +53,7 @@ deps = -rrequirements.txt -rtest_requirements.txt docformatter - pylint >= 3.0.0, < 3.1.0 + pylint >= 3.2.0, < 3.3.0 setuptools yamllint >= 1.26.0 commands =