Replace resolve_path() with os.path.join()#8646
Merged
natefoo merged 6 commits intogalaxyproject:devfrom Sep 24, 2019
Merged
Conversation
natefoo
approved these changes
Sep 16, 2019
352ca43 to
dbaf928
Compare
Member
Author
|
Rebased. |
dbaf928 to
901a3b6
Compare
nsoranzo
added a commit
to nsoranzo/galaxy
that referenced
this pull request
Sep 20, 2019
for config files. Broken in galaxyproject#921 . For context, see galaxyproject#8639 (comment) Includes also elimination of `resolve_path` function as in galaxyproject#8646
nsoranzo
added a commit
to nsoranzo/galaxy
that referenced
this pull request
Sep 20, 2019
for config files. Broken in galaxyproject#921 . For context, see galaxyproject#8639 (comment) Includes also elimination of `resolve_path` function as in galaxyproject#8646
- Modify defaults in the schema so that correct values are loaded (add notes to description where applicable). - When the default in schema was inconcsistent with the default loaded in `__init__.py`, use the latter. - Replace `kwargs.get(foo, default)` with `self.foo` if default is set correctly in the schema. - Remove redundant assignments and variables (there are still more left). - The defalt for `citation_cache_lock_dir` should be `citations/locks`. - In a few cases where defaults are NOT loaded in `__init__.py`, and the values are clearly meant to be suggested values, move those defaults into description.
As per discussion in code review.
This is just a hunch. The test shouldn't fail, and it doesn't fail locally. It seems this might fix it (and point to the cause).
- Modify defaults in the schema so that correct values are loaded (add notes to description where applicable). - When the default in schema was inconcsistent with the default loaded in `__init__.py`, use the latter. - Replace `kwargs.get(foo, default)` with `self.foo` if default is set correctly in the schema. - Remove redundant assignments and variables (there are still more left). - The defalt for `citation_cache_lock_dir` should be `citations/locks`. - In a few cases where defaults are NOT loaded in `__init__.py`, and the values are clearly meant to be suggested values, move those defaults into description.
The function was redundant: it checked whether its argument was an absolute path, and if not, called os.path.join. This is exactly what os.path.join already does (python 3.x and 2.7) The only benefit of having a separate function is the ability to add additinal processing to such calls - so when we need that, we can add it. Meanwhile, it removes unnecessary function calls + makes the code slightly less complex. The function is not called from outside this module (not to be confused with the resolve_path method of the mixin class), but it's duplicated in webapps/reports/config.py and webapps/tool_shed/config.py (which are not addressed in this commit).
70abac0 to
cf0242d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is waiting on #8639 (first commit: 2762a9d)
Rationale for modification in commit message.