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

Road to PyPI #87

Closed
13 tasks done
krs013 opened this issue Oct 31, 2019 · 6 comments
Closed
13 tasks done

Road to PyPI #87

krs013 opened this issue Oct 31, 2019 · 6 comments

Comments

@krs013
Copy link
Collaborator

krs013 commented Oct 31, 2019

This issue is for tracking the tasks that need to or should be done before putting the project up on PyPI.

  • Restructure source tree: put pyboy directory at the root level, and move scripts like main.py inside, possibly as __main__.py (python -m pyboy) or as a setuptools script.
  • Move vital functionality into setup.py so it doesn't need external configuration (currently in Makefile) to run properly.
  • Figure out how to deal with the Cython/PyPy duality.
  • Figure out what goes in the sdist: Cython? Cythonized .c files? Test modules? Examples? OpenGL w/o dependencies?
  • Figure out how to make an sdist and get setup.py to install from it via pip.
  • Ensure correctness of requirements.txt. (Check dependencies match requirements.txt #82)
  • Speaking of bundling, figure out how to bundle SDL2 or maybe download a copy on install? Maybe that's for built distributions, though. Nah
  • Fix attribution for sdl2.pxd, or install as a dependency.
  • Ensure that PyBoy can run outside of the build directory structure (i.e., won't crash for lack of directories like ROMs, recordings, etc...
  • Silence the logging printouts, or at least add an option to do so. (Improve the logging implementation #88)
  • Assign a semantic version number.
  • Double check license compatibility.
  • Claim pyboy on pypi.org and upload PyBoy!

That's all I can think of for now but there are probably things I forgot. Also we can mention issues here that we'd like to fix before uploading, but I don't think any of the current ones besides #82 need to be closed before we have something publishable. We can discuss the items in the checklist here or create separate issues for the conversation.

@Baekalfen
Copy link
Owner

Nice job. Looks like you did your homework ;)

About bundling system dependencies (SDL2/OpenGL), from experience, that is just not handled by pip. For example with NumPy, PyOpenGL, and PySDL2, they all just crash, if the system dependencies are not installed.

@krs013
Copy link
Collaborator Author

krs013 commented Nov 5, 2019

Yeah, looks like it's not canonical, but I think it'd be technically possible to bundle a copy to fall back on if there's no system version. Even if we do that eventually, though, we can safely choose to not bother for now, so I'll update the list to reflect that.

@a-hurst
Copy link

a-hurst commented Jan 14, 2020

@krs013 @Baekalfen I think I might have an clean solution for bundling/installing the SDL2 binaries on macOS and Windows! Basically, after a good deal of headaches trying to streamline the install process for my own pysdl2-dependent project, I wrote a package that downloads and extracts all the official libsdl.org binaries for the current platform, adds them as data to a pip-installable Python package, and then sets PYSDL2_DLL_PATH to point to that folder when the package is imported: https://github.com/a-hurst/pysdl2-dll

I'm also co-maintainer of the pysdl2 project now and am hopeful official support can be added in the next PyPI release (i.e. if sdl2dll is installed as a package, pysdl2 will load it automatically without needing to be imported explicitly). Once that's sorted, I'll also be putting binary wheels of pysdl2dll on PyPI for easier installation and dependency pinning.

Hope you find it useful!

@krs013
Copy link
Collaborator Author

krs013 commented Jan 15, 2020

Thanks @a-hurst, sounds cool! I'll have to take a look at that. If nothing else, it will be nice to have that as a prompt to a user who doesn't have SDL2 configured properly to install it if there's an import error.

In general we're looking toward using pysdl2 as a dependency only when running under PyPy, since the Cython version can interact with the API pretty naturally, and we haven't used many of the more advanced features in a while. OTOH, if you're considering adding Cython support for pysdl2 (not that I expect that by any means) let me know and I'd be happy to help bring that about too!

@Baekalfen
Copy link
Owner

@a-hurst @krs013 Adding Cython support to pysdl2 would be an awesome feature. I would definitely contribute as well, if that could be done

@a-hurst
Copy link

a-hurst commented Jan 30, 2020

@krs013 @Baekalfen As long as it wouldn't require a massive rewrite or break existing functionality, I'd be 100% on board with an effort to add Cython support to PySDL2. I'm only just learning some Cython myself so I'm not sure how much use I'd be, but if either of you have any interest in getting the ball rolling I'd be happy to help in any way I can, and to accept any related pull requests!

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

No branches or pull requests

3 participants