Skip to content

Commit

Permalink
Migrate setuptools to full pyproject.toml only (#61)
Browse files Browse the repository at this point in the history
Also switched the build system to hatchling and hatch-vcs.
  • Loading branch information
yunzheng authored Oct 11, 2024
1 parent 62ed6a3 commit 7e9f95e
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 106 deletions.
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

98 changes: 94 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,99 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = 'setuptools.build_meta'
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.setuptools_scm]
write_to = "dissect/cobaltstrike/_version.py"
[project]
name = "dissect.cobaltstrike"
dynamic = ["version"]
description = "a Python library for dissecting Cobalt Strike related data"
requires-python = ">=3.9"
license = {text = "MIT License"}
readme = "README.rst"
authors = [
{name = "Yun Zheng Hu", email = "hu@fox-it.com"},
]
dependencies = [
"dissect.cstruct >= 4.2",
"lark",
]
keywords = ["dissect", "cobaltstrike", "beacon", "parser", "parsing", "lark", "cstruct"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Security",
"Topic :: Utilities",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.urls]
documentation = "https://dissect-cobaltstrike.readthedocs.io/"
repository = "https://github.com/fox-it/dissect.cobaltstrike"

[project.optional-dependencies]
c2 = [
"flow.record",
"pycryptodome",
"httpx",
]
pcap = [
"pyshark",
"dissect.cobaltstrike[c2]",
]
full = [
"dissect.cobaltstrike[c2,pcap]",
"rich",
]
test = [
"pytest",
"pytest-cov",
"pytest-httpserver",
"dissect.cobaltstrike[full]",
]
docs = [
"sphinx",
"sphinx_rtd_theme>=2.0",
"sphinx-autoapi",
"sphinx-copybutton",
"sphinx-argparse-cli",
"ipython",
"pickleshare",
"dissect.cobaltstrike[full]",
]

[project.scripts]
beacon-artifact = "dissect.cobaltstrike.artifact:main"
beacon-dump = "dissect.cobaltstrike.beacon:main"
beacon-xordecode = "dissect.cobaltstrike.xordecode:main"
beacon-pcap = "dissect.cobaltstrike.pcap:main"
beacon-client = "dissect.cobaltstrike.client:main"
c2profile-dump = "dissect.cobaltstrike.c2profile:main"

[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "dissect/cobaltstrike/_version.py"

[tool.hatch.build.targets.sdist]
exclude = [
"/tests/beacons/",
"/tests/profiles/",
]

[tool.hatch.build.targets.wheel]
only-include = ["dissect/cobaltstrike", "tests", "docs"]

[tool.black]
line-length = 120
Expand Down
90 changes: 0 additions & 90 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ commands = pre-commit run --all-files
[testenv:build]
skip_install = true
deps =
setuptools==60.10.0 # somehow v61.0.0 breaks bdist_wheel, pin to 60.10.0 for now
setuptools_scm[toml]
hatchling
hatch-vcs
build
twine
commands =
python -m build --no-isolation # use --no-isolation so we can use our pinned versions
python -m build
twine check dist/*

0 comments on commit 7e9f95e

Please sign in to comment.