From f0173d89a65775d8cdc7670daf7a6c1b24a4cfa2 Mon Sep 17 00:00:00 2001 From: N3rdL0rd <168280212+N3rdL0rd@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:14:21 -0600 Subject: [PATCH] Migrate dependencies to pyproject.toml --- .github/workflows/python-package.yml | 3 +-- README.md | 6 +++--- build => build.sh | 0 pyproject.toml | 19 +++++++++++++++++++ requirements.txt | 13 ------------- 5 files changed, 23 insertions(+), 18 deletions(-) rename build => build.sh (100%) mode change 100755 => 100644 delete mode 100644 requirements.txt diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7b72a07..e09692f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,8 +27,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install pytest mypy types-tqdm + python -m pip install -e .[dev] - name: Set up Haxe uses: krdlab/setup-haxe@v1 with: diff --git a/README.md b/README.md index 82e826c..b470126 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ Pure Python HashLink bytecode parser/disassembler/decompiler/modding tool ## Installation ```bash -# TODO: pip package +pip install crashlink # TODO: publish to PyPI ``` Optionally, install `tqdm` for progress bars when parsing large files: ```bash -pip install tqdm +pip install crashlink[tqdm] ``` You also need to have Graphviz installed to generate control flow graphs. On most *nix systems, on Windows (with Chocolatey or Scoop), and on MacOS (with Homebrew), you can install it with your package manager under `graphviz`. @@ -71,7 +71,7 @@ For development purposes, you can clone the repo, install development dependenci ```bash git clone https://github.com/N3rdL0rd/crashlink cd crashlink -pip install -r requirements.txt +pip install -e .[dev] pytest ``` diff --git a/build b/build.sh old mode 100755 new mode 100644 similarity index 100% rename from build rename to build.sh diff --git a/pyproject.toml b/pyproject.toml index 7326111..eb0e62e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,29 @@ classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", + "Topic :: Software Development :: Disassemblers", ] license = {file = "LICENSE"} dependencies = [] +[project.optional-dependencies] +dev = [ + "pdoc3", + "black", + "build", + "twine", + "isort", + "mypy", + "radon", + "no_implicit_optional", + "pytest", + "tqdm", + "snakeviz", + "typeguard", + "types-tqdm", +] +tqdm = ["tqdm"] + [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 97d22d4..0000000 --- a/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -pdoc3 -black -build -twine -isort -mypy -radon -no_implicit_optional -pytest -tqdm -snakeviz -typeguard -types-tqdm \ No newline at end of file