#625 Decouple mod definitions from web app

Open
opened 1 month ago by sparr · 2 comments
sparr commented 1 month ago

Something Else

Currently momw.data_seeds.mod_data and its sibling modules depend on all of django even if they are being used separately from the modding-openmw.com web application. And even if these dependencies are met, the code in the modules can't run without the web app being running, making the mod definitions inaccessible. If this dependency was decoupled then the same data could be used directly in another application, such as a mod installer or manager. If there's interest in this decoupling happening then I'd be up for working on it; I'm already having to hack some stuff into my own code to work around it anyway.

### Something Else Currently `momw.data_seeds.mod_data` and its sibling modules depend on all of django even if they are being used separately from the modding-openmw.com web application. And even if these dependencies are met, the code in the modules can't run without the web app being running, making the mod definitions inaccessible. If this dependency was decoupled then the same data could be used directly in another application, such as a mod installer or manager. If there's interest in this decoupling happening then I'd be up for working on it; I'm already having to hack some stuff into my own code to work around it anyway.
Poster
Owner

Thanks for the suggestion! There's no real reason why the mod data needs to be coupled to the main application.

Maybe it could live in its own namespace so that something like from momwdata import architecture is possible.

I would love it if you worked on this, but let me think a little bit about how we should approach it.

Thanks for the suggestion! There's no real reason why the mod data needs to be coupled to the main application. Maybe it could live in its own namespace so that something like `from momwdata import architecture` is possible. I would love it if you worked on this, but let me think a little bit about how we should approach it.
hristoast added the
Code/Testing
label 1 month ago
hristoast added this to the Release: 3.0 milestone 1 month ago
Poster
Owner

I'd like to take the approach of containing this data in its own git repo where it lives as importable python data.

  • Create momwdata repo and add it as a submodule
  • Add momw/momw/data_seeds/by_category/* to the root of the momwdata repo
    • The lists/YAML data should be split out too, but can be considered out of scope for this specific task
  • Change data imports (here), see what breaks, and fix as needed

This task is completed when:

@sparr please don't hesitate to reach out on IRC, I'm the op in #momw. We can discuss specifics and etc. I'll create the repo and add you to it as a contributor.

I'd like to take the approach of containing this data in its own git repo where it lives as importable python data. * Create momwdata repo and add it as a submodule * Add `momw/momw/data_seeds/by_category/*` to the root of the momwdata repo * The lists/YAML data should be split out too, but can be considered out of scope for this specific task * Change data imports ([here](https://git.modding-openmw.com/Modding-OpenMW.com/momw/src/commit/53f74a1040a384880bed911044a8f8e6a1f29eff/momw/momw/data_seeds/mod_data.py#L1-L34)), see what breaks, and fix as needed This task is completed when: - [ ] The mod data exists in a separate git repo - [ ] That data is in use by the web app - [ ] That data is importable for use in software that's unrelated to the momw webapp - [ ] There is documentation on how to use the data in a project - [ ] Tests pass, and all of this is live on at least the beta website @sparr please don't hesitate to reach out on IRC, I'm the op in #momw. We can discuss specifics and etc. I'll create the repo and add you to it as a contributor.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.