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

Fixes Setup.py error on Windows #676 #734

Closed
wants to merge 14 commits into from
Closed

Fixes Setup.py error on Windows #676 #734

wants to merge 14 commits into from

Conversation

Sai-Adarsh
Copy link
Contributor

@Sai-Adarsh Sai-Adarsh commented Jan 21, 2019

Fixes Setup.py error on Windows, added shell script to check python environment, prints the python version, copy files from /kubernetes/base to /kubernetes/ and finally runs python setup.py install issue #676

Fixes Setup,py error on Windows, added shell script to check python environment, print the python version, copy files from /kubernetes/base to /kubernetes/ and finally runs python setup.py install
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 21, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Sai-Adarsh
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: roycaihw

If they are not already assigned, you can assign the PR to them by writing /assign @roycaihw in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 21, 2019
@Sai-Adarsh
Copy link
Contributor Author

@micw523 gave a PR. could you check this out.

@Sai-Adarsh
Copy link
Contributor Author

/assign @roycaihw

@Sai-Adarsh
Copy link
Contributor Author

/assign @micw523

@Sai-Adarsh Sai-Adarsh changed the title Fixes Setup,py error on Windows #676 Fixes Setup.py error on Windows #676 Jan 21, 2019
@k8s-ci-robot
Copy link
Contributor

@Sai-Adarsh: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

@appendly: changing LGTM is restricted to assignees, and only kubernetes-client/python repo collaborators may be assigned issues.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

echo Python environment found..
fi
python --version
cp -R ../kubernetes/base/* ../kubernetes/
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the reason to do the 'cp -R' above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what's the reason to do the 'cp -R' above?

"When we clone submodule with git the folders in the /kubernetes/base is supposed to be symbolically linked in the /kubernetes directory. In Windows this is not done. For a Windows developer, we’ll need to have a script copying all the base/* folders into */. "

^ is what @micw523 requested in his issue. so 'cp -R' does the job.

@@ -0,0 +1,11 @@
if ! [ -x "$(command -v python)" ];
then
echo Python environment notfound..
Copy link
Contributor

Choose a reason for hiding this comment

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

probably add double quotes around the echo string

then
echo Python environment notfound..
else
echo Python environment found..
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

cool. will do the necessary changes

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
echo Python environment found..
echo Python environment found.

scripts/setup-fix.bat Outdated Show resolved Hide resolved
echo "Python environment notfound.."
else
echo "Python environment found.."
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check windows batch scripting syntax for if

@micw523
Copy link
Contributor

micw523 commented Jan 22, 2019

To be honest this looks like bash instead of a Windows bat. You could probably use it in a Cygwin but I think Windows developers would prefer a genuine bat.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 24, 2019
@Sai-Adarsh
Copy link
Contributor Author

@micw523 done with the changes. could you check on the new commit :)

Copy link
Contributor

@micw523 micw523 left a comment

Choose a reason for hiding this comment

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

I have a few comments -

  • Could you break your command into several lines? It is difficult to decipher at its current state
  • xcopy is considered an external program and has been deprecated since '07. Could you try using copy or robocopy?

@Sai-Adarsh
Copy link
Contributor Author

I have a few comments -

  • Could you break your command into several lines? It is difficult to decipher at its current state
  • xcopy is considered an external program and has been deprecated since '07. Could you try using copy or robocopy?

done with the changes.

@@ -0,0 +1,5 @@
( where python >null
echo Python environment found..
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case Python environment found will be printed regardless.

Copy link
Contributor

Choose a reason for hiding this comment

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

python > null and found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

python > null and found.

cool. done with the changes.

Copy link
Contributor

@micw523 micw523 left a comment

Choose a reason for hiding this comment

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

Please fix your indents - the conditional statements are not aligned.
Also, one period for output message is sufficient.
On the last line ../ - the slash is not needed and on Windows you're supposed to use backslash anyway so cd .. should be good enough

@Sai-Adarsh
Copy link
Contributor Author

Please fix your indents - the conditional statements are not aligned.
Also, one period for output message is sufficient.
On the last line ../ - the slash is not needed and on Windows you're supposed to use backslash anyway so cd .. should be good enough

done.

Copy link
Contributor

@micw523 micw523 left a comment

Choose a reason for hiding this comment

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

See suggestion

@Sai-Adarsh
Copy link
Contributor Author

See suggestion

done with changes.

@micw523
Copy link
Contributor

micw523 commented Jan 28, 2019

/lgtm
/cc @roycaihw

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2019
Copy link
Member

@roycaihw roycaihw left a comment

Choose a reason for hiding this comment

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

/hold

Please add comments in the bat describing what it's for. Probably also name the file "windows-setup-fix.bat" to make it more clear. LGTM otherwise

@@ -0,0 +1,6 @@
( python --version>nul 2>&1 && (
echo Python environment found.
Copy link
Member

Choose a reason for hiding this comment

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

just out of curiosity: was the double quote change @yliaog suggested reverted for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just out of curiosity: was the double quote change @yliaog suggested reverted for some reason?

works fine without double qoute, so thought of reverting the change :)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 29, 2019
@Sai-Adarsh
Copy link
Contributor Author

/hold

Please add comments in the bat describing what it's for. Probably also name the file "windows-setup-fix.bat" to make it more clear. LGTM otherwise

cool.

@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2019
@Sai-Adarsh
Copy link
Contributor Author

/hold

Please add comments in the bat describing what it's for. Probably also name the file "windows-setup-fix.bat" to make it more clear. LGTM otherwise

@roycaihw could you check on the new changes?

@roycaihw
Copy link
Member

Could you add the comments to the beginning of the file? Basically I was asking for a description so that people can tell what it's for and when it should be used. I think we don't need inline comments.

Something like "Install python client in Windows. Windows doesn't have symbolic link that this repo uses. This batch script provides a workaround for symbolic link by copying the folders over."

Also please squash your commits before submit

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 29, 2019
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 30, 2019
@micw523
Copy link
Contributor

micw523 commented Feb 7, 2019

Will lg()tm after squash

@Sai-Adarsh
Copy link
Contributor Author

Will lg()tm after squash

cool.

@Sai-Adarsh Sai-Adarsh closed this Feb 20, 2019
Sai-Adarsh added a commit to Sai-Adarsh/python that referenced this pull request Mar 9, 2019
Would like to join a GitHub team of kubernetes-client, and highly interested to join as a reviewer. Have previously merged a fix (kubernetes-client#734).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants