-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup new project structure using setup.cfg * Add Static typing, linting and test libraries - Lint all files using flake8 * Disable VS Code linting * Improve robustness of query functions * Add query function tests * Add full code coverage to tests * Linting * Setup Github actions * Change commands in tox.ini * Update README
- Loading branch information
1 parent
73ea3aa
commit b65f120
Showing
19 changed files
with
251 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Tests | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ['3.6', '3.7', '3.8', '3.9'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
- name: Test with tox | ||
run: tox |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"python.linting.enabled": true, | ||
"python.linting.enabled": false, | ||
"python.linting.pylintEnabled": true | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[build-system] | ||
requires = ["setuptools>=42.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov=sqleyes" | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
[tool.mypy] | ||
mypy_path = "." | ||
check_untyped_defs = true | ||
disallow_any_generics = true | ||
ignore_missing_imports = true | ||
no_implicit_optional = true | ||
show_error_codes = true | ||
strict_equality = true | ||
warn_redundant_casts = true | ||
warn_return_any = true | ||
warn_unreachable = true | ||
warn_unused_configs = true | ||
no_implicit_reexport = true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
flake8==4.0.1 | ||
tox==3.24.5 | ||
pytest==7.0.1 | ||
pytest-cov==3.0.0 | ||
mypy===0.931 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[metadata] | ||
name = sqleyes | ||
version = 0.1.0 | ||
description = A CLI in Python that analyzes raw SQL queries for common anti-patterns | ||
long_description_content_type = text/markdown | ||
long_description = file: README.md | ||
keywords = SQL, anti-patterns, analysis | ||
author = Leonardo Mathon | ||
author_email = [email protected] | ||
home_page = leonardomathon.nl | ||
license = MIT | ||
license_file = LICENSE | ||
requires_dist = setuptools | ||
platforms = unix, linux, osx, cygwin, win32 | ||
classifiers = | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
License :: OSI Approved :: MIT License | ||
Operating System :: OS Independent | ||
|
||
[options] | ||
packages = | ||
sqleyes | ||
install_requires = | ||
sqlparse>=0.4.2 | ||
python_requires = >=3.6 | ||
package_dir = | ||
=. | ||
zip_safe = no | ||
|
||
[options.extras_require] | ||
testing = | ||
pytest>=7.0 | ||
pytest-cov>=3.0 | ||
mypy>=0.910 | ||
flake8>=4.0 | ||
tox>=3.24 | ||
|
||
[options.package_data] | ||
sqleyes = py.typed | ||
|
||
[flake8] | ||
max-line-length = 80 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,4 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
|
||
def read_requirements(file): | ||
with open(file) as f: | ||
return f.read().splitlines() | ||
|
||
def read_file(file): | ||
with open(file) as f: | ||
return f.read() | ||
|
||
long_description = read_file("README.md") | ||
version = read_file("VERSION") | ||
requirements = read_requirements("requirements.txt") | ||
|
||
setup( | ||
name = 'sqleyes', | ||
version = version, | ||
author = 'Leonardo Mathon', | ||
author_email = '[email protected]', | ||
url = 'leonardomathon.nl', | ||
description = 'A CLI in Python that analyzes raw SQL queries for common anti-patterns', | ||
long_description_content_type = "text/markdown", # If this causes a warning, upgrade your setuptools package | ||
long_description = long_description, | ||
license = "MIT license", | ||
packages = find_packages(exclude=["test"]), # Don't include test directory in binary distribution | ||
install_requires = requirements, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] # Update these accordingly | ||
) | ||
if __name__ == "__main__": | ||
setup() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Empty file.
This file contains 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
Oops, something went wrong.