Skip to content

Commit

Permalink
Applied updates and worked on CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 31, 2024
1 parent 5cece68 commit 9a7ad8a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 35 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['39']
version: ['39', '40']
container:
image: registry.fedoraproject.org/fedora:${{ matrix.version }}
steps:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
dnf copr -y enable @gift/dev
dnf install -y @development-tools python3 python3-devel libbde-python3 libcaes-python3 libcreg-python3 libevt-python3 libevtx-python3 libewf-python3 libexe-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwevt-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 libwrc-python3 python3-acstore python3-artifacts python3-cffi python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-dtfabric python3-idna python3-pytsk3 python3-pyyaml python3-setuptools python3-xattr
dnf install -y @development-tools libbde-python3 libcaes-python3 libcreg-python3 libevt-python3 libevtx-python3 libewf-python3 libexe-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwevt-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 libwrc-python3 python3 python3-acstore python3-artifacts python3-build python3-cffi python3-devel python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-dtfabric python3-idna python3-pytsk3 python3-pyyaml python3-setuptools python3-wheel python3-xattr
- name: Run tests
env:
LANG: C.utf8
Expand All @@ -27,21 +27,17 @@ jobs:
- name: Run end-to-end tests
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: Build source distribution
- name: Build source distribution (sdist)
run: |
python3 ./setup.py sdist
- name: Build binary distribution
python3 -m build --no-isolation --sdist
- name: Build binary distribution (wheel)
run: |
python3 ./setup.py bdist
- name: Run build and install test
run: |
python3 ./setup.py build
python3 ./setup.py install
python3 -m build --no-isolation --wheel
test_ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['22.04']
version: ['24.04']
container:
image: ubuntu:${{ matrix.version }}
steps:
Expand All @@ -58,7 +54,7 @@ jobs:
run: |
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential python3 python3-dev libbde-python3 libcaes-python3 libcreg-python3 libevt-python3 libevtx-python3 libewf-python3 libexe-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwevt-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 libwrc-python3 python3-acstore python3-artifacts python3-cffi-backend python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-distutils python3-dtfabric python3-idna python3-pip python3-pytsk3 python3-setuptools python3-wheel python3-xattr python3-yaml
apt-get install -y build-essential libbde-python3 libcaes-python3 libcreg-python3 libevt-python3 libevtx-python3 libewf-python3 libexe-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwevt-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 libwrc-python3 python3 python3-acstore python3-artifacts python3-build python3-cffi-backend python3-dev python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-distutils python3-dtfabric python3-idna python3-pip python3-pytsk3 python3-setuptools python3-wheel python3-xattr python3-yaml
- name: Run tests
env:
LANG: en_US.UTF-8
Expand All @@ -69,16 +65,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
- name: Build binary distribution
- name: Build source distribution (sdist)
run: |
python3 ./setup.py bdist
- name: Run build and install test
python3 -m build --no-isolation --sdist
- name: Build binary distribution (wheel)
run: |
python3 ./setup.py build
python3 ./setup.py install
python3 -m build --no-isolation --wheel
2 changes: 1 addition & 1 deletion scripts/eventlog_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def Main():
with open(options.source, 'r', encoding='utf-8') as file_object:
source_definitions = list(yaml.safe_load_all(file_object))

except (SyntaxError, UnicodeDecodeError):
except (SyntaxError, UnicodeDecodeError, yaml.parser.ParserError):
source_definitions = [{
'source': options.source, 'windows_version': options.windows_version}]

Expand Down
2 changes: 1 addition & 1 deletion scripts/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def Main():
with open(options.source, 'r', encoding='utf-8') as file_object:
source_definitions = list(yaml.safe_load_all(file_object))

except (SyntaxError, UnicodeDecodeError):
except (SyntaxError, UnicodeDecodeError, yaml.parser.ParserError):
source_definitions = [{
'source': options.source, 'windows_version': options.windows_version}]

Expand Down
10 changes: 1 addition & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = winevtrc
version = 20240304
version = 20240331
description = Windows Event Log resources (winevtrc)
long_description = winevtrc is a Python module part of winevt-kb to allow easy reuse of the Windows Event Log resource extraction and database functionality.
long_description_content_type = text/plain
Expand Down Expand Up @@ -39,13 +39,5 @@ exclude =
utils
where = .

[sdist]
template = MANIFEST.in
manifest = MANIFEST

[sdist_test_data]
template = MANIFEST.test_data.in
manifest = MANIFEST.test_data

[bdist_wheel]
universal = 1
9 changes: 8 additions & 1 deletion tests/dfvfs_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pathlib
import os
import sys
import unittest

from dfvfs.lib import definitions as dfvfs_definitions
Expand Down Expand Up @@ -83,7 +84,9 @@ def testJoinPath(self):
dfvfs_definitions.TYPE_INDICATOR_OS, location=test_file_path)
test_helper.OpenFileSystem(path_spec)

path_segments = os.path.split(test_file_path)
# Make sure path segments is a list, since os.path.split() can return a
# tuple.
path_segments = list(os.path.split(test_file_path))

path = test_helper.JoinPath(path_segments)
self.assertEqual(path, test_file_path)
Expand Down Expand Up @@ -144,6 +147,10 @@ def testSplitPath(self):
expected_path_segments.pop(0)

path_segments = test_helper.SplitPath(test_file_path)
if sys.platform.startswith('win'):
# Remove drive letter for comparison.
path_segments.pop(0)

self.assertEqual(path_segments, expected_path_segments)


Expand Down

0 comments on commit 9a7ad8a

Please sign in to comment.