litestar-org/litestar-fullstack

Bug: standalone packaging issues

Opened this issue · 1 comments

Description

Hi, I was looking for references to make a standalone litestar (trying to avoid rewriting part of our backend in node for our electron app) and I ran across a few issues. I'd be happy to make a PR with fixes based on feedback.

  • jsbeautifier only has a source distribution see here. This conflicts with the "PYAPP_PIP_EXTRA_ARGS": "--only-binary :all:" setting. jsbeautifier seems to be a requirement for the cli dependencies. We can remove the extra args for now, but binary only is a good sanity check for making sure that clients can install without a build toolchain. So it would be nice to have a binary only install possible. We could also specify the the format control but but it doesn't seem to support :all: + explicit excludes pip issue. Only explicit includes, so we would have to explicitly set all the deps for binary only which would be a pita unless there's a programmatic way of doing it.
  • The export of the requirements.txt is not required if you have a wheel file which is the current default. We can maybe leave those lines as a comment. I personally use hatch which doesn't have an equivalent export.
  • wget and tar subprocess calls are not generally portable (cuz of windows), and the standalones created by pyapp is platform specific without cross compilation. We should use equivalent python stdlib functionality to do those steps (urllib.request and tarfile resp.)

P.S. I didn't run the repo, I was taking parts of it for inspiration. But as far as I can tell, these all affect the main repo.

URL to code causing the issue

https://github.com/litestar-org/litestar-fullstack/blob/main/scripts/post-builds.py

MCVE

# Your MCVE code here

Steps to reproduce

steps for jsbeautifier issue.

1 - compile pyapp (suceeds)
2 - run pyapp, fails at env resolution

Screenshots

"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

*** jsbeautifier conflict log ***

The conflict is caused by:
    litestar[standard] 2.8.3 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.8.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.8.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.8.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.7.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.7.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.7.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.6.4 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.6.3 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.6.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.6.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.6.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.5 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.4 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.3 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.5.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.5 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.4 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.3 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.4.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.3.2 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.3.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.3.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.2.1 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.2.0 depends on jsbeautifier; extra == "standard"
    litestar[standard] 2.1.1 depends on jsbeautifier; extra == "cli" or extra == "standard" or extra == "full"
    litestar[standard] 2.1.0 depends on jsbeautifier; extra == "cli" or extra == "standard" or extra == "full"
    litestar[standard] 2.0.1 depends on jsbeautifier; extra == "cli" or extra == "standard" or extra == "full"
    litestar[standard] 2.0.0 depends on jsbeautifier; extra == "cli" or extra == "standard" or extra == "full"

Package Version

All

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

@GuillaumeQuenneville I'd be happy to accept a PR here. This was an area where I'd been doing a lot experimenting, so it's nice to see others taking a look.