harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases
http://harelba.github.io/q/
GNU General Public License v3.0
10.19k stars 421 forks source link

fix/harelba/q#301 #304

Open Sparkx120 opened 1 year ago

Sparkx120 commented 1 year ago

Fix for #301

This fixes the issue where you cannot install from setup.py by setting the package explicitly.

kim-fehl commented 1 year ago

I confirm that this patch is working, tested on Python: 3.9.14 and Debian 11

InCogNiTo124 commented 1 year ago

@harelba could you please look at this and merge it?

harelba commented 1 year ago

Sorry i missed this PR. Thanks!

I need to make sure that build and packaging is not reliant on the hardcoded bin/ path, and then I'll merge it.

raylu commented 1 year ago

I was actually about to submit a PR for

diff --git a/setup.py b/setup.py
index 6d0fac7..11c07f8 100644
--- a/setup.py
+++ b/setup.py
@@ -22,10 +22,10 @@ setup(
         'six==1.11.0'
     ],
     package_dir={"": "bin"},
-    packages=setuptools.find_packages(where="bin"),
+    py_modules=['q'],
     entry_points={
         'console_scripts': [
-            'q = bin.q:run_standalone'
+            'q = q:run_standalone'
         ]
     }
 )

before I saw this. it's worth noting that

$ python3 -c 'import setuptools; print(setuptools.find_packages(where="bin"))'
[]

the existing packaging (deb, rpm, msi) don't actually build the python sdist/wheel (pip3 install build && python3 -m build or python3 setup.py build), so this doesn't affect existing packaging (also, this setup.py file just doesn't work as is right now)