-
Notifications
You must be signed in to change notification settings - Fork 975
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
Refactor setup.py
#3393
Refactor setup.py
#3393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very much appreciate refactor towards spec modularization allowing to add a new feature in easier way.
IMO, a potential step further is coming to ./pysetup/{feature_name}.py
file containing all required definitions named according to some convention, e.g. FeatureNameBuilder
, feature_name_md_files
, and so on, including a parent phase. Then setup.py
can have a list of enabled features and can seek for required information to build a spec for particular feature relying on the convention. And spec editors will have to follow the convention which isn't that bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great step in the right direction! Adding features can become less painful in the near future
88d14df
to
33d31b9
Compare
Issue
Our lengthy
setup.py
is so difficult to read. It will be more and more complicated when we introduce more feature specs.How did I mitigate it
Break
setup.py
into multiple files:pysetup/constants.py
: constantspysetup/helpers.py
: misc helperspysetup/md_doc_paths.py
: the markdown file paths settingpysetup/spec_builders.py
: theSpecBuilder
implementations of each forkpysetup/typing.py
: theNamedTuple
data structures used in building the specI didn't move the helper functions that utilize the
ruamel.yaml
ormarko
packages, which require installation viasetup.py
. Despite this, I think this refactoring helpssetup.py
concentrate on package dependencies management.TODO: