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

Remove hardcoded constant from config module #4704

Merged
merged 3 commits into from
Oct 23, 2018

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Oct 2, 2018

fix #4388 and also nofi x #4401

@@ -135,25 +135,40 @@ class BuildConfigBase(object):
version = None

def __init__(self, env_config, raw_config, source_file, source_position):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open an issue about removing source_position, I think we have a card to track this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output_base = os.path.abspath(
os.path.join(
self.env_config.get('output_base', base_path),
self.env_config.get('output_base', self.base_path),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from validate_base we should remove that and validate_name, we never used that, probably another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #4706

:param env_config: A dict that cointains additional information
about the environment.
:param raw_config: A dict with all configuration without validation.
:param source_file: The file that contains the configuration.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably rename this to be more accurate?

@stsewd
Copy link
Member Author

stsewd commented Oct 2, 2018

Looks like #4401 comes from another part of the code https://github.com/rtfd/readthedocs.org/blob/67dfae9de7be81af92bd88453427424111a6168f/readthedocs/projects/tasks.py#L424-L424 Should be addressed in another PR, but we are close here.

@agjohnson
Copy link
Contributor

I can't tell how this is going to resolve #4401. It seems the resolution on that issue was to alter the actual error message surfaced to the user.

@stsewd
Copy link
Member Author

stsewd commented Oct 2, 2018

@agjohnson I got confused, then I realize my own comment #4401 (comment). This is ready for review

@stsewd stsewd requested a review from a team October 2, 2018 19:05
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@agjohnson agjohnson merged commit ea058d5 into readthedocs:master Oct 23, 2018
@stsewd stsewd deleted the remove-hardcoded-constant branch October 23, 2018 16:44
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

Successfully merging this pull request may close these issues.

Refactor BuildConfig to not use hardcoded constants
2 participants