Skip to content

Commit 48028cb

Browse files
committed
Added proper setup.py
1 parent 91346a7 commit 48028cb

File tree

5 files changed

+74
-14
lines changed

5 files changed

+74
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# FletcherFiltering
2-
SQL to HLS hardware filtering for Flechter streams
2+
SQL to HLS compiler that generates hardware filters and transformations for [Flechter](https://github.com/johanpel/fletcher) streams.

_old/schema-test/schema_test.py

-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
import numpy as np
2-
3-
import pandas as pd
4-
51
import pyarrow as pa
62

7-
import pyarrow.parquet as parquet
8-
9-
10-
113
if __name__ == "__main__":
124
in_schema = pa.schema([('id', pa.int32(), False),
135
('int1', pa.int32(), False),

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
https://github.com/EraYaN/moz-sql-parser/archive/object-ast.zip
22
typed-ast
3-
pandas
43
pyarrow
54
numpy
65
horast

setup.py

+69-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,71 @@
11
from setuptools import setup, find_packages
2+
import importlib
23

3-
setup(name="fletcherfiltering",
4-
setup_requires=["pytest-runner", ...],
5-
tests_require=["pytest", ...],
6-
packages=find_packages())
4+
def find_version(
5+
package_name: str, version_module_name: str = 'settings',
6+
version_variable_name: str = '__version__') -> str:
7+
"""Simulate behaviour of "from package_name._version import VERSION", and return VERSION."""
8+
version_module = importlib.import_module(
9+
'{}.{}'.format(package_name.replace('-', '_'), version_module_name))
10+
return getattr(version_module, version_variable_name)
11+
12+
setup(
13+
name='FletcherFiltering',
14+
version=find_version('fletcherfiltering'),
15+
# packages=['fletcherfiltering', 'fletcherfiltering.codegen', 'fletcherfiltering.codegen.exceptions',
16+
# 'fletcherfiltering.codegen.transformations', 'fletcherfiltering.codegen.transformations.helpers'],
17+
package_dir={'': 'src'},
18+
package_data={'': ['**/template.*']},
19+
include_package_data=True,
20+
url='https://github.com/EraYaN/FletcherFiltering',
21+
license='',
22+
author='Erwin de Haan',
23+
author_email='',
24+
long_description=open('README.md').read(),
25+
long_description_content_type='text/markdown',
26+
description='',
27+
classifiers=[
28+
'Development Status :: 3 - Alpha',
29+
'Environment :: Console',
30+
'Intended Audience :: Developers',
31+
'Intended Audience :: Science/Research',
32+
'Natural Language :: English',
33+
'Operating System :: POSIX',
34+
'Operating System :: Microsoft :: Windows',
35+
'Operating System :: MacOS',
36+
'Programming Language :: Python :: 3 :: Only',
37+
'Programming Language :: C++',
38+
'Topic :: Education',
39+
'Topic :: Scientific/Engineering',
40+
'Topic :: Software Development :: Code Generators',
41+
'Topic :: Software Development :: Compilers',
42+
'Topic :: Software Development :: Pre-processors',
43+
'Topic :: Utilities'
44+
],
45+
install_requires=[
46+
'moz-sql-parser',
47+
'typed-ast',
48+
'pyarrow',
49+
'numpy',
50+
'horast',
51+
'astunparse',
52+
'typed-astunparse',
53+
'transpyle[c,cpp]',
54+
],
55+
dependency_links=[
56+
'https://github.com/EraYaN/moz-sql-parser/archive/sql-to-cpp'
57+
'https://github.com/EraYaN/transpyle/archive/sql-to-cpp'
58+
],
59+
setup_requires=[
60+
"pytest-runner"
61+
],
62+
tests_require=[
63+
"pytest",
64+
"pytest-cov",
65+
"pytest-print",
66+
"pytest-progress",
67+
"mysql-connector-python",
68+
"lipsum"
69+
],
70+
packages=find_packages('./src')
71+
)

src/fletcherfiltering/settings.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import pyarrow as pa
22

3+
from version_query import predict_version_str
4+
5+
__version__ = predict_version_str()
6+
37
DEBUG = False
48

59
MINIMAL_QUERY_LENGTH = len('SELECT *')

0 commit comments

Comments
 (0)