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

Building from Source - Fails on importing fitfile module #258

Open
delize opened this issue Jan 4, 2025 · 2 comments
Open

Building from Source - Fails on importing fitfile module #258

delize opened this issue Jan 4, 2025 · 2 comments

Comments

@delize
Copy link

delize commented Jan 4, 2025

Describe the bug
Unable to make setup from source

To Reproduce
Steps to reproduce the behavior:

  1. Clone Github Repo
  2. Run make setup
  3. Receive Error

Expected behavior
Expected to have make setup complete successfully.

Logs

~/Documents/github/GarminDB master
$ make setup                                                                                                [10:31:53]
$PROJECT_BASE is [/Users/username/Documents/github/GarminDB]
$PLATFORM is [Darwin]
$SHELL is [/bin/sh]
$PIP_PATH is [/opt/homebrew/bin/pip3]
python3 -m venv --upgrade-deps /Users/username/Documents/github/GarminDB/.venv
git submodule init
Submodule 'Fit' (https://github.com/tcgoetz/Fit.git) registered for path 'Fit'
Submodule 'Plugins' (https://github.com/tcgoetz/GarminDbPlugins.git) registered for path 'Plugins'
Submodule 'Tcx' (https://github.com/tcgoetz/Tcx.git) registered for path 'Tcx'
Submodule 'utilities' (https://github.com/tcgoetz/utilities.git) registered for path 'utilities'
git submodule update
Cloning into '/Users/username/Documents/github/GarminDB/Fit'...
Cloning into '/Users/username/Documents/github/GarminDB/Plugins'...
Cloning into '/Users/username/Documents/github/GarminDB/Tcx'...
Cloning into '/Users/username/Documents/github/GarminDB/utilities'...
Submodule path 'Fit': checked out '306ad50288a1ead8dec9502708560d410ac69306'
Submodule path 'Plugins': checked out '82bd3faba1de9bbd9eb7e2bf82687b62d7458c7a'
Submodule path 'Tcx': checked out '277b2748d01df47e3d696e876c8a0947997e6162'
Submodule path 'utilities': checked out '5ce3f712f34818cddf5327cd827a480989ff6940'
python -c 'import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Documents/github/GarminDB/garmindb/__init__.py", line 15, in <module>
    from .activity_fit_file_processor import ActivityFitFileProcessor
  File "/Users/username/Documents/github/GarminDB/garmindb/activity_fit_file_processor.py", line 10, in <module>
    import fitfile
ModuleNotFoundError: No module named 'fitfile'
make: *** [version_check] Error 1

Additional context

$ python --version                                                                                          [10:32:02]
Python 3.13.1

$ command -v python                                                                                         [10:34:25]
/opt/homebrew/opt/python@3/libexec/bin/python

$ system_profiler SPSoftwareDataType                                                                        [10:37:23]
Software:

    System Software Overview:

      System Version: macOS 15.2 (24C101)
      Kernel Version: Darwin 24.2.0

@delize delize changed the title Building from Source - Building from Source - Failes on importing fitfile module Jan 4, 2025
@delize
Copy link
Author

delize commented Jan 4, 2025

Running the pip module does work fine.

@delize delize changed the title Building from Source - Failes on importing fitfile module Building from Source - Fails on importing fitfile module Jan 4, 2025
@CRMemory
Copy link

CRMemory commented Feb 3, 2025

I encounter the same issue and tried digging a bit deeper. The order of execution is: make setup -> Target setup_install -> target version_check -> Call to

python -c 'import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])'

This is failing because import garmindb.version is executing garmindb.__init__.py which in turn tries importing fitfile which is not available in a fresh environment.
Here, I'm not sure what the intended behavior is. Maybe the fitfile module should've been taken from the Fit submodule in which case setting up the PYTHONPATH is missing, however garmindb.__init__.py als includes completely external dependencies like sqlalchemy that would need installation.

Or maybe the idea is to use the internally created venv and have all dependencies install first before doing the version check. In this case I'm wondering why Fit, Tcx and utilities are git submodules if fitfile, tcxfile and idbutils are installed via pip/pypi for the venv?

@tcgoetz - Any suggestion which way is inteded? I'll happily work towards a fix.

P.S. Small sidenote: The execution will still fail, because garmindb.version.python_dev_version_check() is calling idbutils.version.python_version_check() with verbose=True but the function does not accept this parameter.

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

2 participants