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 configuration for building wheels #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eleftherioszisis
Copy link

@wackywendell , I would like to first thank you for this package, which helped me a lot through my studies. In return, I would like to contribute to the building of wheels so that this tool can be easily used in different systems without compilation, which many times could prove tedious.

Summary of changes:

  • setuptools transparently fallbacks to using the cpp file when cython is not available, therefore no need for a manual switch.
  • Added github workflow for building wheels for linux, mac os and windows using cibuildwheel (py37-310)
  • Added github workflow for running the tests.
  • Replaced nose with the more recent and maintained pytest.
  • Moved the tests in a dedicated tests/ folder so that they work better with pytest.
  • Added a tox.ini which standardizes the testing (See https://tox.wiki/en/latest/)
  • Added setuptools_scm, which allows extracting python package version via the git metadata (No need for manually changing a version on the setup.py. Making a release and a tag propagates the version to the package via setuptools_scm).

These changes maintained the current functionality of using cython to compile the pyx file whenever cython is available, otherwise compiling the cpp source, which is bundled with the package. However, imho it would be cleaner and more robust if the project strictly used cython, allowing to add a pyproject.toml config with the cython dependency as a build requirement. Then if needed to be built from source, cython would be required and no intermediate files would need to be used, otherwise one could install the wheels and easily use the package.

To enable the wheel publishing to pypi step, a new release with its respective tag vX.X.X needs to be made.

Closes #9

@dimateos
Copy link

dimateos commented Mar 2, 2023

Just to let you know that I succesfully installed it for python 3.10.8. I had to install wheel and setuptools manually tho. Anyway thanks!

@itsmegughan
Copy link

Just to let you know that I succesfully installed it for python 3.10.8. I had to install wheel and setuptools manually tho. Anyway thanks!

Could you please describe how you did it? I'm having trouble installing in wsl2.

@dimateos
Copy link

Basically:

pip install wheel
pip install setuptools-scm
pip install setuptools
...
pip uninstall tess --yes
... 
REM potentially delete binaries
pip install --editable %path_root_of_tess%

Note that in my case I install a local version of the library.
Sometimes to force the recompilarion I had to delete /build and /tess/_voro.*.pyd

You can check out the scripts I use:
https://github.com/dimateos/UPC-MIRI-TFM/blob/main/scripts/install_deps.bat
https://github.com/dimateos/UPC-MIRI-TFM/blob/main/scripts/update.bat

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

Successfully merging this pull request may close these issues.

Wheels for python3.8
3 participants