HaxeFoundation / HaxeFoundation/haxe

[python] resources are not embedded

Open
#8,060 1 comment 0 reactions 0 assignees View on GitHub
platform-python
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

>Haxe provides a simple resource embedding system that can be used for embedding files directly into the compiled application.

The [docs on resources](https://haxe.org/manual/cr-resources.html) suggest that they are always embedded, even if concrete implementation details vary a bit (several targets, including Python, are actually missing here btw). But the end result is always that you only have a single file to worry about.

On Python, something like this instead causes the resource to simply be _copied_ to a `main.py.test` file next to the `.py`:

```hxml
-python main.py
-resource test.txt@test
```

Is there a good reason for this? Wouldn't it make more sense to follow the same approach as the JS and Lua targets, where resources are embedded via static fields?

Sidenote: on PHP, resources don't seem to be embedded either, but that seems less problematic since that's already not generated as a self-contained file anyway.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.