forked from yandex/gixy
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor header checks, setup, and CI testing
Updated `add_header_multiline.py` and `setup.py` for string standardization and better dependency management. Switched CI testing to use pytest instead of nosetests, and included `pytest-xdist` in dev requirements for parallel test execution.
- Loading branch information
1 parent
b20bed7
commit 67cecfe
Showing
4 changed files
with
70 additions
and
52 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ pytest>=7.0.0 | |
coverage>=4.3 | ||
flake8>=3.2 | ||
tox>=2.7.0 | ||
pytest-xdist |
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,17 +1,33 @@ | ||
import re | ||
from setuptools import setup, find_packages | ||
|
||
# FileNotFoundError is not there in Python 2, define it: | ||
try: | ||
FileNotFoundError | ||
except NameError: | ||
FileNotFoundError = IOError | ||
|
||
with open('gixy/__init__.py', 'r') as fd: | ||
version = re.search(r'^version\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
fd.read(), re.MULTILINE).group(1) | ||
with open("gixy/__init__.py", "r") as fd: | ||
version = re.search( | ||
r'^version\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE | ||
).group(1) | ||
|
||
if not version: | ||
raise RuntimeError('Cannot find version information') | ||
raise RuntimeError("Cannot find version information") | ||
|
||
install_requires = [ | ||
"pyparsing>=1.5.5,<=2.4.7", | ||
'cached-property>=1.2.0;python_version<"3.8"', | ||
'argparse>=1.4.0;python_version<"3.2"', | ||
"six>=1.1.0", | ||
"Jinja2>=2.8", | ||
"ConfigArgParse>=0.11.0", | ||
] | ||
|
||
tests_requires = [ | ||
"pytest>=7.0.0", | ||
"pytest-xdist", | ||
] | ||
|
||
# README.md is not present in Docker image setup | ||
long_description = None | ||
|
@@ -22,42 +38,38 @@ | |
pass | ||
|
||
setup( | ||
name='gixy-ng', | ||
name="gixy-ng", | ||
version=version, | ||
description='NGINX configuration [sec]analyzer', | ||
description="NGINX configuration [sec]analyzer", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
keywords='nginx security lint static-analysis', | ||
author='Yandex IS Team, GetPageSpeed LLC', | ||
author_email='[email protected], [email protected]', | ||
url='https://github.com/dvershinin/gixy', | ||
install_requires=[ | ||
'pyparsing>=1.5.5,<=2.4.7', | ||
'cached-property>=1.2.0;python_version<"3.8"', | ||
'argparse>=1.4.0;python_version<"3.2"', | ||
'six>=1.1.0', | ||
'Jinja2>=2.8', | ||
'ConfigArgParse>=0.11.0' | ||
], | ||
keywords="nginx security lint static-analysis", | ||
author="Yandex IS Team, GetPageSpeed LLC", | ||
author_email="[email protected], [email protected]", | ||
url="https://github.com/dvershinin/gixy", | ||
install_requires=install_requires, | ||
extras_require={ | ||
"tests": install_requires + tests_requires, | ||
}, | ||
entry_points={ | ||
'console_scripts': ['gixy=gixy.cli.main:main'], | ||
"console_scripts": ["gixy=gixy.cli.main:main"], | ||
}, | ||
packages=find_packages(exclude=['tests', 'tests.*']), | ||
packages=find_packages(exclude=["tests", "tests.*"]), | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Environment :: Console', | ||
'Intended Audience :: System Administrators', | ||
'Intended Audience :: Developers', | ||
'Topic :: Security', | ||
'Topic :: Software Development :: Quality Assurance', | ||
'Topic :: Software Development :: Testing', | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Intended Audience :: System Administrators", | ||
"Intended Audience :: Developers", | ||
"Topic :: Security", | ||
"Topic :: Software Development :: Quality Assurance", | ||
"Topic :: Software Development :: Testing", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12" | ||
"Programming Language :: Python :: 3.12", | ||
], | ||
include_package_data=True | ||
include_package_data=True, | ||
) |