ManderaGeneral / generalpackager

Tools to interface GitHub, PyPI, NPM and local modules / repos. Used for generating files to keep projects dry and synced. Tailored for ManderaGeneral for now.
https://pypi.org/project/generalpackager/
Apache License 2.0
0 stars 0 forks source link

New GenerateFile structure #19

Closed Mandera closed 1 year ago

Mandera commented 1 year ago

Consider changing generated file structure to having a single python file for each GenerateFile containing everything.

Coupling Packager to each GenerateFile python file could look like this:

    @property
    @deco_cache()
    def readme_file(self):
        from generalpackager.api.localrepo.files.readme import ReadmeFile
        return ReadmeFile(packager=self)

Then we can have a separate bottom file for storing relative paths in a class that both LocalRepo and GenerateFiles can use.

How is LocalRepo going to access it? Maybe we can have the class of ReadmeFile being available as classmethods for LocalRepo and Packager

Mandera commented 1 year ago

Could change it so that this is the only entry:

@deco_cache()
def get_readme_file(self):
    return GenerateFile(...)

Then we have path, and file accessible directly instead of having all_files_by_relative_path()

Mandera commented 1 year ago

It would also be nice to have relative paths being available to class, not only instance - Maybe just a simple dict for that?

Mandera commented 1 year ago

A bit more work than anticipated but coming along nicely. New structure is so much cleaner and it's very clear to see that most of the methods are for readme and workflow