Build and dependency updates#73
Merged
samizdatco merged 10 commits intoplotdevice:mainfrom May 20, 2025
Merged
Conversation
By prefixing the build command with PYTHONNOUSERSITE=1 we ignore user site packages, ensuring modules are properly installed into the relocatable framework.
The HTTP session was being initialized at module import time, which required all HTTP-related dependencies to be available before plotdevice could be imported. This caused build failures since the dependencies weren't yet installed during the build process. Changes: - Made HTTP session initialization lazy via get_http_session() - Only import HTTP dependencies when actually making requests - Added better error message if dependencies are missing - Updated read() function to use lazy initialization This allows plotdevice to be imported and built without having HTTP dependencies pre-installed, fixing the circular dependency issue during installation.
Added missing dependency that was causing build failures: - filelock: Required by cachecontrol for file caching
Updated the clean command to remove additional build artifacts: - Added .eggs directory - Added *.egg files - Added __pycache__ directories - Added .pyc files - Added local development virtualenv Also modified CleanCommand to: - Added --dist flag to CleanCommand for dist cleaning - Kept DistCleanCommand as separate command for backward compatibility
Added ability to bypass pip's cache when building the app bundle: - Added --no-cache flag to BuildAppCommand in setup.py - Modified Makefile to conditionally set PIP_NO_CACHE_DIR based on environment - Allows clean builds with fresh package downloads via `python setup.py app --no-cache`
- now uses `filelock` rather than the deprecated `lockfile`
- satisfies a deprecation warning from setuptools
samizdatco
approved these changes
Apr 6, 2025
Member
samizdatco
left a comment
There was a problem hiding this comment.
Thanks so much for these new setup.py features & fixes! I made a couple tweaks to the dependency lists to a) keep Python.framework and plotdevice using the same (old) version of PyObjC, and b) clear up cachecontrol's lockfile/filelock support.
I also dropped the license string from the CLASSIFIERS list (since that's apparently been deprecated?) and fixed the CI tests by manually installing setuptools now that it's no longer present by default.
Would you mind doing a test build on your end to confirm that I didn't break any of your nice work in the process?
Contributor
Author
|
Confirming that the build works for me! Thanks for clearing up the dependencies. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes some small changes to the build process and dependencies:
python setup.py appAdded filelock to package dependencies (needed for CacheControl FileCache)
Lazy initialisation for URL handling in readers.py
I've tested: