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

add setup script, rename prefix script into local_setup #38

Merged
merged 2 commits into from
May 4, 2018

Conversation

dirk-thomas
Copy link
Member

While not complete (the .bat scripts still need to be refactored) I would like to get a first review / feedback if that is the desired result.

@dirk-thomas dirk-thomas added the enhancement New feature or request label Apr 27, 2018
@dirk-thomas dirk-thomas added this to the 0.1.1 milestone Apr 27, 2018
@dirk-thomas dirk-thomas self-assigned this Apr 27, 2018
@dirk-thomas dirk-thomas added the review Waiting for review (Kanban column) label Apr 27, 2018
@codecov-io
Copy link

codecov-io commented Apr 27, 2018

Codecov Report

Merging #38 into master will increase coverage by 0.17%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
+ Coverage   77.61%   77.78%   +0.17%     
==========================================
  Files          48       48              
  Lines        2519     2543      +24     
  Branches      400      405       +5     
==========================================
+ Hits         1955     1978      +23     
  Misses        550      550              
- Partials       14       15       +1
Impacted Files Coverage Δ
colcon_core/shell/bat.py 100% <100%> (ø) ⬆️
colcon_core/shell/sh.py 100% <100%> (ø) ⬆️
colcon_core/shell/__init__.py 99.02% <93.75%> (-0.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a5ccfa...8809ed5. Read the comment docs.

@@ -310,3 +310,40 @@ def create_environment_hook(
'Could not find a primary shell extension for creating an '
'environment hook')
return hooks


_colcon_prefix_path_cache = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why cache the result? Can the COLCON_PREFIX_PATH environment variable change between calls to get_colcon_prefix_path()?

Copy link
Member Author

@dirk-thomas dirk-thomas Apr 28, 2018

Choose a reason for hiding this comment

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

I tried to describe that in the docblock:

The result is being cached based on the passed skip parameter to avoid printing the warning on repeated invocations.

While the environment isn't supposed to change during one run of the tool the fact that the result would be invalid if the environment does change isn't really a good idea.

I refactored the logic in 6694243 to actually store which warning has already been logged and just use that global information to avoid repeating the warning. The computation happens every time and is therefore correct no matter what happens to the environment.

Copy link

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

I didn't check the batch and powershell since I didn't have a Windows boot handy, but the Linux variant checks out okay, including the overlay mechanism.

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

LGTM.

I didn't check the .sh code. I checked that sourcing setup.bat chained workspaces successfully using some python packages. In a fresh cmd instance sourcing setup.bat of the last workspace in a chain resulted in aPYTHONPATH containing all workspaces from the highest workspace to the lowest.

@dirk-thomas
Copy link
Member Author

Ignoring failing CI which is due to a regression in the new flake8-builtins release.

@dirk-thomas dirk-thomas merged commit ce10892 into master May 4, 2018
@dirk-thomas dirk-thomas deleted the refactor_setup_files branch May 4, 2018 17:25
@dirk-thomas dirk-thomas removed the review Waiting for review (Kanban column) label May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

4 participants