Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #7

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Python tests

on:
push:
pull_request:

jobs:
test:

runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff pytest pytest-cov pytest-console-scripts
python -m pip install -vvv .
- name: Lint with Ruff
run: |
ruff check .
continue-on-error: true
- name: "Test with pytest on ${{ matrix.os }} Python ${{ matrix.python-version }}"
run: |
coverage run -m pytest --log-level INFO
- name: Generate Coverage Report
run: |
coverage report -m
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
build*
.idea
dist
build
*.egg-info
__pycache__
.tox
.coverage
report.xml
coverage.xml
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

43 changes: 36 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
import os
import shutil
import subprocess
import sys
from pathlib import Path

from setuptools import find_packages
from setuptools import setup
from setuptools.command.build import build
from setuptools.command.install import install

here = Path(__file__).parent.resolve()
build_dir = here / "build"
build_type = "Release"


class MyInstall(install):
class MyBuild(build):
def run(self):
if subprocess.call(["cmake", "-S", ".", "-B", build_dir.resolve()]) != 0:
sys.exit(-1)
if subprocess.call(["cmake", "--build", build_dir.resolve(), "--config", build_type]) != 0:
if (
subprocess.call(
["cmake", "--build", build_dir.resolve(), "--config", build_type]
)
!= 0
):
sys.exit(-1)
# Try to install but ignore errors if permission is denied
subprocess.call(["cmake", "--install", build_dir.resolve(), "--config", build_type])
install.run(self)
return super().run()


class MyInstall(install):
def run(self):
if "VIRTUAL_ENV" in os.environ and sys.platform == "win32":
shutil.copy(
build_dir / build_type / "unstream.exe",
Path(os.environ["VIRTUAL_ENV"]) / "Scripts" / "unstream.exe",
)
return super().run()


setup(
name="anssi-orcdecrypt",
version="4.1",
version="5.3.2",
url="https://github.com/DFIR-ORC/orc-decrypt",
license="LGPL-2.1+",
author="Sebastien Chapiron",
Expand All @@ -36,10 +51,22 @@ def run(self):
install_requires=["cryptography>=0.6"],
packages=find_packages(where="src"),
package_dir={"": "src"},
data_files=[
(
"bin",
[
(
str(build_dir / build_type / "unstream.exe")
if sys.platform == "win32"
else str(build_dir / "unstream")
),
],
),
],
zip_safe=False,
entry_points={
"console_scripts": [
"orc-decrypt=anssi_orcdecrypt.cli:main",
"orc-decrypt=orcdecrypt.cli:entrypoint",
],
},
classifiers=[ # Optional
Expand All @@ -49,11 +76,13 @@ def run(self):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Operating System :: Unix",
],
python_requires=">=3.8, <4",
cmdclass={
"build": MyBuild,
"install": MyInstall,
},
)
3 changes: 0 additions & 3 deletions src/anssi_orcdecrypt/__init__.py

This file was deleted.

Loading