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

Refactor & Cleanup setup.py / setup.cfg #632

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SimonCW
Copy link
Collaborator

@SimonCW SimonCW commented Mar 3, 2022

Hi @maciejkula,

I changed a few things about the setup here:

@SimonCW SimonCW force-pushed the refactor/setup branch 3 times, most recently from e2af42f to cf8e3be Compare March 3, 2022 19:50
Update miniconda versions


Re-Add name


Try to fix builds


For debugging ...


Fix path


Reset changes
@SimonCW SimonCW marked this pull request as ready for review March 3, 2022 20:23
@SimonCW SimonCW marked this pull request as draft March 4, 2022 09:24
@SimonCW
Copy link
Collaborator Author

SimonCW commented Mar 4, 2022

Mh, currently it is hard for me to fix our builds and tests b/c they are spread over appveyor, travis, circleci . Some of these services don't provide very good convenience images (appveyor) and it is hard to find good examples of how to use this properly.

I think this would be solved by moving to github actions. Additionally, we could automate the build process for the docs.

Initial experiments with GH Actions here: #636

@SimonCW
Copy link
Collaborator Author

SimonCW commented Mar 6, 2022

The tests for windows are failing but I don't know why (https://github.com/SimonCW/lightfm/runs/5440138903?check_suite_focus=true). I might try to debug with my other Windows Laptop later this week. I also quickly checked https://github.com/pypa/cibuildwheel/, which looks promising for creating windows and macOS wheels.

@SimonCW
Copy link
Collaborator Author

SimonCW commented Mar 20, 2022

The build wheel action is running successfully but the created wheel doesn't work for me. Installing the wheel from the artifacts here: https://github.com/SimonCW/lightfm/actions/runs/1983477030 and running

python -c "from lightfm import LightFM
from lightfm.datasets import fetch_movielens
from lightfm.evaluation import precision_at_k

# Load the MovieLens 100k dataset. Only five
# star ratings are treated as positive.
data = fetch_movielens(min_rating=5.0)

# Instantiate and train the model
model = LightFM(loss='warp')
model.fit(data['train'], epochs=30, num_threads=2)

# Evaluate the trained model
test_precision = precision_at_k(model, data['test'], k=5).mean(); print(test_precision)"

Gives this error:

/Users/simon.weiss/Repos/contrib/lightfm/lightfm/_lightfm_fast.py:9: UserWarning: LightFM was compiled without OpenMP support. Only a single thread will be used.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/simon.weiss/Repos/contrib/lightfm/lightfm/__init__.py", line 2, in <module>
    __LIGHTFM_SETUP__
NameError: name '__LIGHTFM_SETUP__' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/simon.weiss/Repos/contrib/lightfm/lightfm/_lightfm_fast.py", line 3, in <module>
    from ._lightfm_fast_openmp import *  # NOQA
ModuleNotFoundError: No module named 'lightfm._lightfm_fast_openmp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/simon.weiss/Repos/contrib/lightfm/lightfm/__init__.py", line 4, in <module>
    from .lightfm import LightFM
  File "/Users/simon.weiss/Repos/contrib/lightfm/lightfm/lightfm.py", line 8, in <module>
    from ._lightfm_fast import (
  File "/Users/simon.weiss/Repos/contrib/lightfm/lightfm/_lightfm_fast.py", line 14, in <module>
    from ._lightfm_fast_no_openmp import *  # NOQA
ImportError: dlopen(/Users/simon.weiss/Repos/contrib/lightfm/lightfm/_lightfm_fast_no_openmp.cpython-38-darwin.so, 0x0002): tried: '/Users/simon.weiss/Repos/contrib/lightfm/lightfm/_lightfm_fast_no_openmp.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

The cython parts still seem to be compiled to x86_64.

@maciejkula, do you have an M1 and could try to run this?

@dbalabka
Copy link

dbalabka commented Mar 8, 2023

@SimonCW, any progress on this? We are looking for a solution to install LightFM on Python 3.10. Updating C files fixes the issue.

@dbalabka
Copy link

dbalabka commented Mar 8, 2023

@SimonCW do you need any help?

@SimonCW
Copy link
Collaborator Author

SimonCW commented Mar 8, 2023

Hey @dbalabka, unfortunately, my current private and work situation doesn't leave any time for LightFM. You are very welcome to take over.

Edit: I'd be happy to give you context and/or test (I am on a M1 pro).

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.

2 participants