Skip to content

Commit

Permalink
Merge pull request #196 from obsidianforensics/issue-192
Browse files Browse the repository at this point in the history
Split out the requirements into different extras; move to pyproject.toml for packaging
  • Loading branch information
obsidianforensics authored Jun 26, 2024
2 parents 637a796 + 92a7192 commit 3706297
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 50 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Test PyPI

on:
workflow_dispatch

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to Test PyPI
runs-on: ubuntu-latest
environment:
name: test_pypi
url: https://test.pypi.org/p/dfir-unfurl
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python -m pip install --upgrade pip
pip install pipenv
pip install flake8 pytest
pip install -r requirements.txt
pip install -r requirements-all.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ dmypy.json

# PyCharm
/.idea/
/venv38/
/dist/
/dfir_unfurl.egg-info/
/build/
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[build-system]
requires = ["setuptools>=61", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[project]
name = "dfir-unfurl"
authors = [{name = "Ryan Benson", email = "[email protected]"}]
readme = "README.md"
requires-python = ">=3.9"
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3"
]
dynamic = ["dependencies", "optional-dependencies", "version"]
description = "Unfurl takes a URL and expands (\"unfurls\") it into a directed graph"
keywords=["unfurl", "forensics", "dfir", "reverse-engineering", "security", "osint", "digital forensics"]

[tool.setuptools_scm]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
version = { attr = "unfurl.__version__" }
optional-dependencies.ui = { file = ["requirements-ui.txt"] }
optional-dependencies.lookups = { file = ["requirements-lookups.txt"] }
optional-dependencies.all = { file = ["requirements-all.txt"] }

[project.scripts]
unfurl = "unfurl.app:cli"
unfurl_app = "unfurl.app:web_app"

[project.urls]
Home = "https://github.com/obsidianforensics/unfurl"
1 change: 1 addition & 0 deletions requirements-all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfir-unfurl[ui,lookups]
2 changes: 2 additions & 0 deletions requirements-lookups.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Requests
maclookup
4 changes: 4 additions & 0 deletions requirements-ui.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flask>=3.0.0
flask-restx>=1.3.0
flask_cors
Werkzeug>=3.0.0
13 changes: 3 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
dnslib
flask == 2.3.3
flask-restx >= 1.2.0
flask_cors
maclookup
networkx
protobuf == 4.*
protobuf==4.*
publicsuffix2
pycountry
pymispwarninglists >= 1.5
Requests
setuptools
pymispwarninglists>=1.5
torf
ulid-py
Werkzeug >= 2.3.3
ulid-py
39 changes: 0 additions & 39 deletions setup.py

This file was deleted.

0 comments on commit 3706297

Please sign in to comment.