-
Notifications
You must be signed in to change notification settings - Fork 950
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
Create a pip installable package #99
Conversation
Hi @calebho , this is great! I need to learn a bit more about how pip works and discuss it with the team. We will take a look at get back to you. In the mean time, do you know why the tests are failing? |
@lanctot Yeah I know why; will try to work on it tonight or tomorrow. It's because the wrong version of cmake is being invoked in CI |
Good morning! Thank you for your contribution. One goal for the library is to be easy to modify, to enable and speed up research on games. Thus, having an install package is definitely a plus, but it is also important to be able to modify the code and built it locally. This CL is changing the full development process (It was just Is the iterative development process still possible with your new way to install a package? Or should we keep both installation procedures (i.e. building as before, and releasing a pip package)? To rephrase, I am wondering: what happens when one want to modify the sources and rebuild? Is the process much different? Is it simply a question of rerunning python3 -m pip install . every time? I looked at it quite extensively, and I think we may want to keep both workflows, as people may prefer one or the other (I also have not tried the pip workflow, so I do not know how good it is, especially when using |
As a side note, as we have no core developer on Mac, it would be really nice to have #84. This CL is changing the build on MAC, and it's very hard for us to test any of this. |
Apologies for the delay as I've been busy the past few days. Will address this sometime this week |
Yes. In order to build and run tests, you can simply invoke
Happy to revert the venv changes--I have a personal preference for standard library tools when there's no compelling reason to use something else. I agree the Mac changes are difficult to test automatically. As you mentioned, #84 will help with this. I happen to have a Mac and a Linux box so I was able to test on both locally. I hope this addresses your concerns @jblespiau; let me know if you have any further questions |
Given that we use a separate workflow within Google, this adds an additional layer to the development process that we cannot experiment ourselfe on our day-to-day work. I would be tempted to prefer an option where we do not change the current way people can build, but in which we add, in addition to the current process, the possibility to build and deploy using pip. Later, if it appears it is superior, we can still drop the current way of developing. I suppose that this would imply, not updating in place all the current install and testing, but adding a new path (e.g. install_with_pip.sh and a specific travis test that runs this). |
Ditto; will work on changes |
|
||
setup( | ||
name="pyspiel", | ||
version="0.0.1rc2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what versioning scheme you folks want to use. Leaving a comment here so that it can be addressed right before merging
Build is failing because the wrong version of |
Thanks. I patched the PR, and tried to run it myself. When I ran it a second time, I got an error however:
I imagine it's because it has already been built, but it would be good to understand why this happens and how to fix it. I also need to find out the next steps to actually make a release/releases out of it. I will not have time in the near future to help debugging this PR. As you say, it's currently not building on Travis, and it's indeed because of a CMake version. The version we currently require is indeed newer than the one supported by setuptools.
Unfortunately, we won't be able to include a change that does not pass the continuous integration tests. It seems there exists addons to support CMake (e.g. https://pypi.org/project/cmake-setuptools/). I have no idea if they are easy to use or would solve the problem. I looked around, and I have also find https://github.com/deepmind/tree/blob/master/setup.py which builds code, but this is using Bazel and not CMake, so It does not help much. Sorry not to be able to help more. |
Thanks for the feedback. I'll have time next week to revisit this |
Okay I think this is in a working state now. Brief summary:
|
Hi @calebho, I changed a few critical files today (related to pip) to allow us to put a requirement of tensorflow >= 1.15 in I've noticed it has created conflict with this PR. Can you pull from master and resolve them? I don't think what I did should be a big problem, but I'm not 100% sure. It was necessary to force an upgrade to pip 19 since it's required by TF 1.15. I also changed the Travis CI meta files and script which I see you had also changed, but I guess the merging should be straight-forward. Let me know, and Happy New Year! |
Oh, we also changed the C++ compiler to use clang instead of g++. So you might want to try installing your pip after the merge just to make sure it compiles properly as before (I had to make one change to CMakeLists.txt for different CXX compilation flags). Here are the changes for the g++ -> clang: 7c6b935 |
Thanks for your contribution, your time, your patience and perseverance. I should have responded last week was I started integrating this change (and got distracted doing it instead of communicating I was doing it^^). This has been submitted internally, we should get it released soon. Thanks again. |
PiperOrigin-RevId: 288263401 Change-Id: I8fbbe97818a4dc4cf69ae3d5a69595da6786ec90
This should alleviate some of the pain in trying to get this installed on Python. Currently I only have sdists working because there are some complexities with bdist_wheel that I can't quite figure out. This should allow you to build and upload to PyPI like so:
If you want to build from source, you can clone the repository and use
pip
to install it:I've also gotten the test command for
setup.py
working, i.e. to run the tests simply callThen users can install with
pip install pyspiel