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

Migrate from setup.cfg to pyproject.toml #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,23 @@ Note that this repository is a loose collection of patches and scripts I had ori
Do read the scripts in `bin` before executing them to make sure you understand what they do.
Tweaking them yourself is to be considered part of standard usage.

I have not tested any of this on Windows myself, though it *should* all work just fine.

Dependencies can be installed using `pip`, as usual:
UnityPackFF and its dependencies can be easily installed with `pip`. It is recommended to add the editable flag `-e`, more about this below.

```
$ sudo pip3 install -r requirements.txt
$ sudo pip install -e .
```

The library itself can also be installed with `setup.py`, like most Python software.
The recommended approach is to install the library in ["Development Mode"](https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html), like so:
The library itself can also be installed with via setuptool's `setup.py`.
Again, the recommended approach is to keep the code editable by installing the library in ["Development Mode"](https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html), like so:

```
$ sudo python3 setup.py develop
$ sudo pip install -r requirements.txt
$ sudo python setup.py develop
```

This places only a reference into your system's package directory as opposed to copying the entire library into a directory that isn't user-writable.
Installing in editable/development mode places only a reference into your system's package directory as opposed to copying the entire library into a directory that isn't user-writable.
This way you can keep modifying the code in your repository directory without having to reinstall the entire thing after every change.
Note that this doesn't seem to work on Windows if Python was installed from the Microsoft Store.
Another option is to just set the `PYTHONPATH` environment variable to this directory.
Another option is to just set the `PYTHONPATH` environment variable to the directory of the repository.

Current features:

Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "unitypack"
version = "0.8.1"
description = "Python implementation of the .unity3d format"
readme = "README.md"
requires-python = ">=3.9"
authors = [{name = "Jerome Leclanche", email = "[email protected]"}]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Multimedia :: Graphics",
]
dependencies = [
"fsb5",
"lz4",
"Pillow",
"tinytag",
"wand",
]

[project.urls]
Homepage = "https://github.com/HearthSim/UnityPack"
Download = "https://github.com/HearthSim/UnityPack/tarball/master"

[tool.setuptools]
script-files = [
"bin/additem.py",
"bin/dump_terrain.py",
"bin/dumpxdt.py",
"bin/ffextract.py",
"bin/list_ab_alt.py",
"bin/list_assetbundle.py",
"bin/list_contents.py",
# bin/proto_extract.py
# bin/proto_mesh_extract.py
"bin/replace_mesh.py",
"bin/replace_terrain.py",
"bin/show_gameobject.py",
"bin/unity2yaml.py",
"bin/unityextract.py",
]
include-package-data = false

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.package-data]
unitypack = ["classes.json", "strings.dat", "structs.dat"]
46 changes: 0 additions & 46 deletions setup.cfg

This file was deleted.

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

from setuptools import setup


setup()