Skip to content

Commit d3a2cf5

Browse files
committed
PyTexturePacker as dependency
1 parent 95e4e60 commit d3a2cf5

4 files changed

Lines changed: 22 additions & 21 deletions

File tree

DEV.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python -m build --wheel
22
python setup.py bdist_wheel
33

4-
pip install .\dist\deppth2-0.1.6.2-py3-none-any.whl
4+
pip install .\dist\deppth2-0.1.6.3-py3-none-any.whl

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ To install Deppth2, `pip install deppth2` or download the latest [wheel](https:/
99

1010
### Dependencies
1111

12-
Deppth2 technically has two required dependencies, `pillow` and `lz4`, as they are the primary tools that deppth2 uses. If an optional dependency is missing, Deppth2 will abort an operation dependent on that module informing you of the missing module.
12+
Deppth2 has three required dependencies, `pillow`, `PyTexturePacker` and `lz4`, as they are the primary tools that deppth2 uses. If an optional dependency is missing, Deppth2 will abort an operation dependent on that module informing you of the missing module.
1313

14-
> As packages primarily contain sprite sheets, deppth2 uses Pillow to work with the image data within. <br>
15-
> Hades/Hades 2 uses LZ4 compression on its packages, and as such, lz4 is automatically installed to allow for deppth2 to work with Hades/Hades 2.
14+
> As packages primarily contain sprite sheets, deppth2 uses [Pillow](https://pypi.org/project/pillow/) to work with the image data within. <br>
15+
> [PyTexturePacker](https://pypi.org/project/PyTexturePacker/) is required to create spiresheets and atlases. <br>
16+
> Hades/Hades 2 uses LZ4 compression on its packages, and as such, [lz4](https://pypi.org/project/lz4/) is automatically installed to allow for deppth2 to work with Hades/Hades 2.
1617
1718
Transistor and Pyre both use LZF compression on their packages. If you plan to work with these packages, you'll want to install the LZF module: `pip install lzf`. You may need to install C++ build tools to get this dependency to install correctly.
1819

@@ -34,7 +35,7 @@ To do this, you can use the **pack** command with the **entries** flag to only i
3435

3536
deppth2 pk -s Launch -t Launch_patch.pkg -e *Launch_Textures02*
3637

37-
I can then distribute Launch_patch.pkg and Launch_patch.pkg_manifest. To apply this patch to the actual package, one would need to place these files in the same folder and then use the **patch** command to perform the patching.
38+
I can then distribute Launch_patch.pkg and Launch_patch.pkg_manifest. To apply this patch to the actual package, one would need to place these files in the same folder and then use the **patch** command to perform the patching.
3839

3940
deppth2 pt Launch.pkg Launch_patch.pkg
4041

@@ -65,7 +66,7 @@ SGGPIO exports two functions, which really just wrap functionality in a variety
6566
with sggpio.open_package('Launch_copy.pkg', 'wm') as pkg_out:
6667
for entry in pkg:
6768
pkg_out.write_entry_with_manifest(entry)
68-
69+
6970
# Print manifest contents of copy to verify success
7071
with sggpio.open_package('Launch_copy.pkg', 'rm') as pkg:
7172
for entry in pkg.manifest:
@@ -77,7 +78,7 @@ In order to pack your `.png` files to be used in Hades II, open the CLI in the p
7778
For example, here is a directory tree.
7879

7980
```
80-
├ <deppth command line open here>
81+
├ <deppth command line open here>
8182
├── NewDeppthPackage
8283
│ ├── GUI
8384
│ │ ├── image1.png

deppth2/deppth2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Top-level API exposure of package actions"""
22

3-
__version__ = "0.1.6.2"
3+
__version__ = "0.1.6.3"
44

55
import os
66
import sys
@@ -16,7 +16,7 @@ def list_contents(name, *patterns, logger=lambda s: None):
1616
for entry in f:
1717
if not _entry_match(patterns, entry):
1818
continue
19-
19+
2020
logger(f'{entry.name}')
2121

2222
atlas = entry.manifest_entry
@@ -52,7 +52,7 @@ def extract(package, target_dir, *entries, subtextures=False, logger=lambda s: N
5252
for entry in f.manifest.values():
5353
if not _entry_match(entries, entry):
5454
continue
55-
55+
5656
logger(f'Extracting manifest entry {entry.name}')
5757
entry.extract(target_dir, subtextures=subtextures, includes=includes)
5858

@@ -101,7 +101,7 @@ def pack(source_dir, package, *entries, subtextures=False, logger=lambda s: None
101101
continue
102102
logger(entry.name)
103103
manifest_entries.append(entry)
104-
104+
105105
with PackageWriter(target, compressor='lz4') as pkg_writer, PackageWriter(f'{target}_manifest') as manifest_writer:
106106
for manifest_entry in manifest_entries:
107107
entry_name = os.path.basename(manifest_entry.name)
@@ -149,7 +149,7 @@ def patch(name, *patches, logger=lambda s : None):
149149
for entry in patch_entries.values():
150150
logger(f'Appending entry {entry.name}')
151151
target.write_entry_with_manifest(entry)
152-
152+
153153
# Delete the old files
154154
os.remove(package_old_path)
155155
os.remove(manifest_old_path)

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
"""setup.py: setuptools control."""
2-
3-
2+
3+
44
import re
55
from setuptools import setup
6-
7-
6+
7+
88
version = re.search(
99
'^__version__\s*=\s*"(.*)"',
1010
open('deppth2/deppth2.py').read(),
1111
re.M
1212
).group(1)
13-
14-
13+
14+
1515
with open("README.md", "rb") as f:
1616
long_descr = f.read().decode("utf-8")
17-
18-
17+
18+
1919
setup(
2020
name = "deppth2",
2121
packages = ["deppth2"],
@@ -24,7 +24,7 @@
2424
},
2525
version = version,
2626
include_package_data=True,
27-
install_requires=['pillow', 'lz4'],
27+
install_requires=['pillow', 'lz4', 'PyTexturePacker'],
2828
package_data={
2929
"deppth2": ["texconv/texconv.exe"]
3030
},

0 commit comments

Comments
 (0)