Package the python tools so they can be installed more easily

This puts the python tools into a python package with a setup.py for installation.
This also updates requirements.txt which was missing "requests" and which depended on a version of "Markdown" which doesn't work with modern Python versions.
This commit is contained in:
Gene Wood 2022-06-21 14:11:05 -07:00 коммит произвёл Tom Ritter
Родитель 3121216fcc
Коммит 33d4030632
6 изменённых файлов: 45 добавлений и 3 удалений

Просмотреть файл

@ -142,14 +142,14 @@ staged in git's index you can pass the `--staged` switch (this is mostly good fo
You'll need a couple of dependency libraries. You can get them with the following command:
```shell
$ pip install -r requirements.txt
$ pip install ./
```
It's best to do that within a [virtualenv](http://virtualenv.readthedocs.org/en/latest/).
Then you can run the command:
```shell
$ ./check_advisories.py
$ check_advisories
Checked 3 files. Found 0 errors.
```

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,4 +1,5 @@
PyYAML==5.4
Markdown==2.5.2
Markdown==3.3.7
python-dateutil==2.4.2
schema==0.7.2
requests

41
setup.py Normal file
Просмотреть файл

@ -0,0 +1,41 @@
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='foundation_security_advisories',
version='1.0.0',
description='Tools supporting the Mozilla Foundation Security Advisories',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/mozilla/foundation-security-advisories',
author='Tom Ritter',
license='MPL-2.0',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: System Administrators',
'Topic :: Security',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Programming Language :: Python :: 3'
],
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
install_requires=[
'PyYAML==5.4',
'Markdown',
'python-dateutil==2.4.2',
'schema==0.7.2',
'requests'],
entry_points={
"console_scripts": [
"update_hof = foundation_security_advisories.update_hof:main",
"check_advisories = foundation_security_advisories.check_advisories:main"
]
}
)