-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
42 lines (36 loc) · 1.38 KB
/
setup.py
File metadata and controls
42 lines (36 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from setuptools import setup, find_packages
import os
import py_compile
"""
setup.py is used with pyproject.toml and setup.cfg to configure and install
SQL Antipattern Scanner package.
File purposes:
- setup.py: Handles package setup, compilation, and distribution.
- pyproject.toml: Specifies build system requirements, project metadata, and dependencies.
- setup.cfg: Contains additional package configuration details.
This script performs following tasks:
1. Compiles .py files to .pyc for improved runtime performance.
2. Defines packages to be included in distribution.
3. Configures package data and exclusions.
4. Calls setup() to create package based on provided configuration.
Note: Most metadata and configuration details are in pyproject.toml and setup.cfg, setup.py
is used for custom build steps and configurations that cannot be easily specified in other
configuration files.
"""
# Compile .py files to .pyc
for root, dirs, files in os.walk("sql_antipattern_scanner"):
for file in files:
if file.endswith(".py"):
py_compile.compile(os.path.join(root, file))
# Setup configuration
setup(
packages=find_packages(include=['sql_antipattern_scanner', 'sql_antipattern_scanner.*']),
package_data={
'sql_antipattern_scanner': [
'config/*.json',
'static/*.css',
]
},
include_package_data=True,
license="MIT",
)