Skip to content

Commit

Permalink
Merge pull request #35 from Pennyw0rth/marshall_cleanup
Browse files Browse the repository at this point in the history
Cleanup & Lint Code
  • Loading branch information
Marshall-Hallenbeck authored Oct 29, 2023
2 parents b21a1eb + 72500d9 commit dee5e28
Show file tree
Hide file tree
Showing 162 changed files with 4,806 additions and 6,490 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint Python code with ruff
# Caching source: https://gist.github.com/gh640/233a6daf68e9e937115371c0ecd39c61?permalink_comment_id=4529233#gistcomment-4529233

on: [push, pull_request]

jobs:
lint:
name: Lint Python code with ruff
runs-on: ubuntu-latest
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies with dev group
run: |
poetry install --with dev
- name: Run ruff
run: |
poetry run ruff --version
poetry run ruff check . --preview
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
name: NetExec Tests for Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
max-parallel: 5
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: NetExec tests on ${{ matrix.os }}
- name: NetExec set up python on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ coverage.xml
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

Expand Down
Empty file removed .gitmodules
Empty file.
17 changes: 6 additions & 11 deletions build_collector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import shutil
import subprocess
Expand All @@ -11,27 +8,26 @@

from shiv.bootstrap import Environment

# from distutils.ccompiler import new_compiler
from shiv.builder import create_archive
from shiv.cli import __version__ as VERSION


def build_nxc():
print("building nxc")
print("Building nxc")
try:
shutil.rmtree("bin")
shutil.rmtree("build")
except Exception as e:
except FileNotFoundError:
pass
except Exception as e:
print(f"Exception while removing bin & build: {e}")

try:
print("remove useless files")
os.mkdir("build")
os.mkdir("bin")
shutil.copytree("nxc", "build/nxc")

except Exception as e:
print(e)
print(f"Exception while creating bin and build directories: {e}")
return

subprocess.run(
Expand All @@ -48,7 +44,6 @@ def build_nxc():
check=True,
)

# [shutil.rmtree(p) for p in Path("build").glob("**/__pycache__")]
[shutil.rmtree(p) for p in Path("build").glob("**/*.dist-info")]

env = Environment(
Expand Down Expand Up @@ -93,7 +88,7 @@ def build_nxcdb():
try:
build_nxc()
build_nxcdb()
except:
except FileNotFoundError:
pass
finally:
shutil.rmtree("build")
92 changes: 0 additions & 92 deletions flake.lock

This file was deleted.

36 changes: 0 additions & 36 deletions flake.nix

This file was deleted.

3 changes: 0 additions & 3 deletions nxc/.hooks/hook-lsassy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all("lsassy")
3 changes: 0 additions & 3 deletions nxc/.hooks/hook-pypykatz.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all("pypykatz")
Loading

0 comments on commit dee5e28

Please sign in to comment.