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

Enable PyPI package management #1154

Merged
merged 1 commit into from
Apr 6, 2015
Merged

Enable PyPI package management #1154

merged 1 commit into from
Apr 6, 2015

Conversation

soltanmm
Copy link
Contributor

@nathanielmanistaatgoogle Please review, inevitably have actionable feedback, deal with the back and forth, and then merge at some point in the future! :-D

args = parser.parse_args()

# Move to the directory of this file.
os.chdir(os.path.dirname(os.path.abspath(__file__)))

Choose a reason for hiding this comment

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

Can these two directory-navigating steps be combined?

Copy link
Contributor

Choose a reason for hiding this comment

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

Even better, don't do this at all, but pass the right directory (the one containing cwd) as the 'cwd' argument to subprocess.call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, that breaks from the pattern of having executables under the tools folder be agnostic to where we are and having them always Do The Right Thing™.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what you mean, sorry. Using the cwd argument to subprocess.Popen doesn't mean you have to run this tool in a specific directory, it just means you don't change the current process's working directory for no good reason. Instead of doing 'os.chdir(pkgdir)' you pass 'cwd=pkgdir' to the two subprocess.call() calls.

@nathanielmanistaatgoogle
Copy link
Member

@Yhg1s, would you mind taking a look at this?

os.chdir('../../../src/python/src')

# Make the push.
cmd = 'python setup.py sdist upload -r %s' % args.repository
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, don't use 'sdist upload'. It's insecure. Use twine: https://pypi.python.org/pypi/twine

@soltanmm soltanmm force-pushed the pypi branch 3 times, most recently from fe9b407 to f476e77 Compare March 31, 2015 19:34
@soltanmm
Copy link
Contributor Author

n.b. CI is failing, possibly due to #1037

@nathanielmanistaatgoogle
Copy link
Member

I have hit the "Restart Job" button on https://travis-ci.org/grpc/grpc/jobs/56619466. :-)

Where's the momentum on this at the moment? Are you still working through @Yhg1s' last round of comments or are you waiting on his next round?

@soltanmm
Copy link
Contributor Author

@nathanielmanistaatgoogle Waiting on the next round.
@Yhg1s Should I care about adding a license file? Each file already has the license file contents at the top. If yes, @nathanielmanistaatgoogle : would you mind if I moved/copied the LICENSE file into src/python/src? Else, I would likely have a stronger preference for keeping the submission script in Python.

@nathanielmanistaatgoogle
Copy link
Member

My aversion to duplicated source resources in source control is strong. Do not copy the LICENSE file in source control if a simple file-copy-during-package-build is a perfectly reasonable alternative.

------------

Ensure that you've built the gRPC core from the root of the
`gRPC git repo`_
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this so that this says to either install the released deb packages on linux or build from source on other platforms; cf these instructiions

@soltanmm
Copy link
Contributor Author

soltanmm commented Apr 2, 2015

@tbetbetbe Is this kind of what you wanted? More detail? Less detail? More cross-references? Wrong cross-referenced resources?

./configure
make && make install

Or install from a debian package:
Copy link
Contributor

Choose a reason for hiding this comment

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

Change the order, e.g.

  • on linux, you can install using the deb package
    ...
  • otherwise, you can install from source
    ...

@soltanmm soltanmm force-pushed the pypi branch 2 times, most recently from a792105 to bdf46d0 Compare April 3, 2015 21:48

Ensure that you have installed GRPC core.

Or install from a debian package:
Copy link
Contributor

Choose a reason for hiding this comment

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

'On debian linux systems, install from our released deb package'

@soltanmm soltanmm force-pushed the pypi branch 2 times, most recently from 10611ef to b5298ba Compare April 6, 2015 18:08
# Move to the root directory of Python GRPC.
pkgdir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../../src/python/src')
os.chdir(pkgdir)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sure I left a comment about this, but I can't find it now (nor the whole conversation it happened in) in GitHub's awful interface.

There is no need to do this os.chdir. Simply pass cwd=pkgdir to the two subprocess.call() calls below (and pass os.path.join(pkgdir, 'dist') to shutil.rmtree on line 39.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbetbetbe added a commit that referenced this pull request Apr 6, 2015
Enable PyPI package management
@tbetbetbe tbetbetbe merged commit e4f2f15 into grpc:master Apr 6, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Feb 1, 2019
@lock lock bot unassigned tbetbetbe Feb 1, 2019
@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants