ucodery / fyeah

Other
23 stars 3 forks source link

yeah on windows prior to python 3.12 #10

Open varioustoxins opened 6 months ago

varioustoxins commented 6 months ago

Thank you for the great project

I have tried to install fyeah on windows prior to python 3.12 as part of supporting my project across all platforms and supported version of python

https://github.com/varioustoxins/NEF-Pipelines

but I get compiler errors with versions prior to python 3.12 and fyeah 0.4.0 (well at least on GitHub actions) the error is here

2024-04-18T20:47:25.0134824Z File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-1zhgi1or\overlay\Lib\site-packages\setuptools_distutils\util.py", line 132, in convert_path 2024-04-18T20:47:25.0136750Z raise ValueError("path '%s' cannot be absolute" % pathname) 2024-04-18T20:47:25.0137911Z ValueError: path '/Users/ucodery/git/fyeah/fyeah/_cfyeah.c' cannot be absolute

url for run on 3.9 is

https://github.com/varioustoxins/NEF-Pipelines/actions/runs/8744395241

is this soluble or should I give up on the idea?

ucodery commented 2 months ago

Thank you for the issue. I see that there is a problem with the C-compiled extension for Windows platforms in earlier versions. However, version 0.4.0 specifically dropped C extensions in favour of a pure-Python implementation. As the logs you linked are no longer available (sorry for the slow response) are you certain that was the version being installed?

varioustoxins commented 2 months ago

I thinks the problem was windows doesn't support the c compilation and 0.4.0 is only specified as being 3.12 + on PyPI. I am most probably heading back to format because unfortunately yeah is dangerous on taking in formatting strings from the user in web abs as it can leak almost any internal state! This isn't a problem yet as my code isn't deployed to the web but it could be in the end...

ucodery commented 2 months ago

I think I understand the issue now. Windows had no wheels in versions < 0.4.0 so pip will build from sdist. There is a universal wheel version I could package for those versions (probably just 0.3.0) as the implementation doesn't depend on C. However, it is unavoidable that using f-yeah can leak internal state as it (and the reference f-strings) exec arbitrary code. Probably not a good idea for user-supplied strings.