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

add full and dev extras #1157

Merged
merged 2 commits into from
Jul 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
5 changes: 2 additions & 3 deletions .github/workflows/build-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install build

- name: Build PyPi packages
run: |
python setup.py sdist --formats=gztar,zip
python setup.py bdist_wheel
python -m build

- name: Archive dist
uses: actions/upload-artifact@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install Cmake
pip install setuptools wheel
pip install build
pip install -r ./test/requirements-testing.txt

- name: Build PyPi packages
run: |
python setup.py sdist --formats=gztar,zip
python setup.py bdist_wheel
python -m build

- name: Download images
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ config*.json
# Pyinstaller files
build
dist
*.egg-info

# Environments
.env
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ Volatility 3 requires Python 3.7.0 or later. To install the most minimal set of
pip3 install -r requirements-minimal.txt
```

Alternately, the minimal packages will be installed automatically when Volatility 3 is installed using setup.py. However, as noted in the Quick Start section below, Volatility 3 does not *need* to be installed via setup.py prior to using it.
Alternately, the minimal packages will be installed automatically when Volatility 3 is installed using pip. However, as noted in the Quick Start section below, Volatility 3 does not *need* to be installed prior to using it.

```shell
python3 setup.py build
python3 setup.py install
pip3 install .
```

To enable the full range of Volatility 3 functionality, use a command like the one below. For partial functionality, comment out any unnecessary packages in [requirements.txt](requirements.txt) prior to running the command.
Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[project]
name = "volatility3"
description = "Memory forensics framework"
keywords = ["volatility", "memory", "forensics", "framework", "windows", "linux", "volshell"]
readme = "README.md"
authors = [
{ name = "Volatility Foundation", email = "volatility@volatilityfoundation.org" },
]
requires-python = ">=3.7.0"
license = { text = "VSL" }
dynamic = ["dependencies", "optional-dependencies", "version"]

[project.urls]
Homepage = "https://github.com/volatilityfoundation/volatility3/"
"Bug Tracker" = "https://github.com/volatilityfoundation/volatility3/issues"
Documentation = "https://volatility3.readthedocs.io/"
"Source Code" = "https://github.com/volatilityfoundation/volatility3"

[project.scripts]
vol = "volatility3.cli:main"
volshell = "volatility3.cli.volshell:main"

[tool.setuptools.dynamic]
version = { attr = "volatility3.framework.constants._version.PACKAGE_VERSION" }
dependencies = { file = "requirements-minimal.txt" }

[tool.setuptools.packages.find]
include = ["volatility3*"]

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ capstone>=3.0.5
pycryptodome

# This is required for memory acquisition via leechcore/pcileech.
leechcorepyc>=2.4.0
leechcorepyc>=2.4.0; sys_platform != 'darwin'

# This is required for memory analysis on a Amazon/MinIO S3 and Google Cloud object storage
gcsfs>=2023.1.0
Expand Down
41 changes: 6 additions & 35 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,21 @@

import setuptools

from volatility3.framework import constants

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()


def get_install_requires():
def get_requires(filename):
requirements = []
with open("requirements-minimal.txt", "r", encoding="utf-8") as fh:
with open(filename, "r", encoding="utf-8") as fh:
for line in fh.readlines():
stripped_line = line.strip()
if stripped_line == "" or stripped_line.startswith("#"):
if stripped_line == "" or stripped_line.startswith(("#", "-r")):
continue
requirements.append(stripped_line)
return requirements


setuptools.setup(
name="volatility3",
description="Memory forensics framework",
version=constants.PACKAGE_VERSION,
license="VSL",
keywords="volatility memory forensics framework windows linux volshell",
author="Volatility Foundation",
long_description=long_description,
long_description_content_type="text/markdown",
author_email="volatility@volatilityfoundation.org",
url="https://github.com/volatilityfoundation/volatility3/",
project_urls={
"Bug Tracker": "https://github.com/volatilityfoundation/volatility3/issues",
"Documentation": "https://volatility3.readthedocs.io/",
"Source Code": "https://github.com/volatilityfoundation/volatility3",
},
packages=setuptools.find_namespace_packages(
include=["volatility3", "volatility3.*"]
),
package_dir={"volatility3": "volatility3"},
python_requires=">=3.7.0",
include_package_data=True,
entry_points={
"console_scripts": [
"vol = volatility3.cli:main",
"volshell = volatility3.cli.volshell:main",
],
extras_require={
"dev": get_requires("requirements-dev.txt"),
"full": get_requires("requirements.txt"),
},
install_requires=get_install_requires(),
)
21 changes: 7 additions & 14 deletions volatility3/framework/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

import volatility3.framework.constants.linux
import volatility3.framework.constants.windows
from volatility3.framework.constants._version import (
PACKAGE_VERSION,
VERSION_MAJOR,
VERSION_MINOR,
VERSION_PATCH,
VERSION_SUFFIX,
)

PLUGINS_PATH = [
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "plugins")),
Expand Down Expand Up @@ -42,20 +49,6 @@
BANG = "!"
"""Constant used to delimit table names from type names when referring to a symbol"""

# We use the SemVer 2.0.0 versioning scheme
VERSION_MAJOR = 2 # Number of releases of the library with a breaking change
VERSION_MINOR = 7 # Number of changes that only add to the interface
VERSION_PATCH = 1 # Number of changes that do not change the interface
VERSION_SUFFIX = ""

# TODO: At version 2.0.0, remove the symbol_shift feature

PACKAGE_VERSION = (
".".join([str(x) for x in [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH]])
+ VERSION_SUFFIX
)
"""The canonical version of the volatility3 package"""

AUTOMAGIC_CONFIG_PATH = "automagic"
"""The root section within the context configuration for automagic values"""

Expand Down
13 changes: 13 additions & 0 deletions volatility3/framework/constants/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# We use the SemVer 2.0.0 versioning scheme
VERSION_MAJOR = 2 # Number of releases of the library with a breaking change
VERSION_MINOR = 7 # Number of changes that only add to the interface
VERSION_PATCH = 1 # Number of changes that do not change the interface
VERSION_SUFFIX = ""

# TODO: At version 2.0.0, remove the symbol_shift feature

PACKAGE_VERSION = (
".".join([str(x) for x in [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH]])
+ VERSION_SUFFIX
)
"""The canonical version of the volatility3 package"""
2 changes: 1 addition & 1 deletion volatility3/framework/interfaces/automagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
context: interfaces.context.ContextInterface,
config_path: str,
*args,
**kwargs
**kwargs,
) -> None:
super().__init__(context, config_path)
for requirement in self.get_requirements():
Expand Down
Loading