posit-dev / posit-dev/shinylive

Shinylive Python Question: Importing from subfolders

Open
#162 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
251
Forks
25
Avg merge
19m
Merged PRs (30d)
2

Description

Curious if it's possible to import modules from local directory-based packages or folders. I feel like I was able to do this a couple of versions back, but I'm unable to now (it's also possible I'm just incorrectly remembering using regular py-shiny as well.

With larger apps/utilities, folders really help for organizing code (i.e., right now I have a utility that contains 28 other module files in the same directory as app.py), but I'm unable to figure out how to successfully import them (I've tried absolute imports, relative imports, regular folders, package folders, etc).

Any direction is helpful. Thanks!

(btw - really enjoying Shinylive)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import attempts described for app.py, comparing absolute imports, relative imports, regular folders, and package folders in Shinylive. Check whether the behavior differs from earlier versions; done means identifying the supported import behavior and documenting or correcting the regression with a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, wasm
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.