Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split code by files #223

Closed
kalombos opened this issue May 3, 2024 · 4 comments
Closed

Split code by files #223

kalombos opened this issue May 3, 2024 · 4 comments
Milestone

Comments

@kalombos
Copy link
Collaborator

kalombos commented May 3, 2024

Нужно вынести части кода в отдельные файлы. Удобнее делать это в несколько итераций, т.к. на данный момент при установке пакет в корень директории с модулями копируются файлы peewee_async.py peewee_asyncext.py Нужно завести директорию peewee-async и перенести в неё peewee_async.py сохранив импорты, также смотри #222

It is necessary to move parts of the code into separate files. It is more convenient to do this in several iterations, because At the moment, when installing the package, the peewee_async.py files peewee_asyncext.py are copied to the root of the directory with modules. You need to create a peewee-async directory and move peewee_async.py to it, saving the imports, also see #222

@kalombos kalombos mentioned this issue May 3, 2024
@rudyryk
Copy link
Member

rudyryk commented May 4, 2024

I suggest to stick with a single peewee_async.py for main implementation.

Not because I dislike modules but because peewee itself is a single peewee.py and it contains much-much more complexity. Being one-file ORM is a spirit of the initial project, and I'd love to follow that.

But what we could to for cleanups it to extract legacy / deprecated modules into peewee_async_compat and just import what we need in peewee_async.py. That would emphasize what is stable core and what is just an old / compatibility layer.

@rudyryk
Copy link
Member

rudyryk commented May 4, 2024

Manager extracted to compatibility module in PR #232

@kalombos
Copy link
Collaborator Author

kalombos commented May 5, 2024

Yeah I know about single peewee.py and i remember how 6-8 years ago my computer slowed down when i opened the file :)This happened because the IDE did not have enough resources to parse a file of 10 thousand lines. And it may lead to cyclic imports and this may lead to import hell :) Also i am worried about that we put all our files(peewee_async, *_compat, *_ext) in the root of the python package directory. It seems no big deal at the moment but you know the Murphy's law... :) Some day somebody will create local peewee_compat file and lose couple of hours in debugging. So i think encapsulate our package at first is not a bad idea :) Splitting also could be helpful for typing #224 to make the process iterative.

All i am trying to say the spirit of peewee is not for free we should pay for it(our time). Do we really need this?

@rudyryk
Copy link
Member

rudyryk commented May 9, 2024

Some day somebody will create local peewee_compat file and lose couple of hours in debugging.

Fair point :) OK, let's split it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants