1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Initial pass at script/update-requirements, results of run

This commit is contained in:
Ross McFarland
2022-01-26 17:47:31 -08:00
parent 5710a7ffeb
commit e25b618e95
8 changed files with 118 additions and 27 deletions

View File

@@ -1,10 +1,22 @@
Pygments==2.11.2
bleach==4.1.0
build==0.7.0 build==0.7.0
coverage cffi==1.15.0
mock cmarkgfm==0.6.0
pycodestyle==2.6.0 colorama==0.4.4
pyflakes==2.2.0 docutils==0.18.1
pytest importlib-metadata==4.10.1
pytest-network keyring==23.5.0
readme_renderer[md]==26.0 pep517==0.12.0
requests_mock pkginfo==1.8.2
twine==3.4.2 pycodestyle==2.8.0
pycparser==2.21
pyflakes==2.4.0
pytest-network==0.0.1
readme-renderer==32.0
requests-toolbelt==0.9.1
rfc3986==2.0.0
tqdm==4.62.3
twine==3.7.1
webencodings==0.5.1
zipp==3.7.0

View File

@@ -1,11 +1,27 @@
PyYaml==5.4 PyYAML==6.0
dnspython==1.16.0 attrs==21.4.0
docutils==0.16 certifi==2021.10.8
fqdn==1.5.0 charset-normalizer==2.0.10
jmespath==0.10.0 coverage==6.3
natsort==6.2.1 dnspython==2.2.0
fqdn==1.5.1
idna==3.3
iniconfig==1.1.1
natsort==8.0.2
packaging==21.3
pluggy==1.0.0
pprintpp==0.4.0
py==1.11.0
pycountry-convert==0.7.2 pycountry-convert==0.7.2
pycountry==22.1.10 pycountry==22.1.10
python-dateutil==2.8.1 pyparsing==3.0.7
requests==2.25.1 pytest-cov==3.0.0
setuptools==60.5.0 pytest-mock==3.6.1
pytest==6.2.5
python-dateutil==2.8.2
repoze.lru==0.7
requests==2.27.1
six==1.16.0
toml==0.10.2
tomli==2.0.0
urllib3==1.26.8

63
script/update-requirements Executable file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env python
from os.path import join
from subprocess import check_call, check_output
from tempfile import TemporaryDirectory
import re
def parse_setup(lines, which):
match = re.search(fr'{which}\w*=\w*[\(\[](?P<list>[^\)\]]*)', lines,
flags=re.DOTALL)
packages = match.groups('list')[0]
packages = re.sub(r"[\"'\s]+", '', packages, flags=re.MULTILINE)
packages = [p for p in packages.split(',') if p]
return packages
with open('setup.py') as fh:
lines = fh.read()
install_requires = parse_setup(lines, 'install_requires')
tests_require = parse_setup(lines, 'tests_require')
dev_requires = [
'build>=0.7.0',
'pycodestyle>=2.6.0',
'pyflakes>=2.2.0',
'readme_renderer[md]>=26.0',
'twine>=3.4.2',
]
def print_packages(packages, heading):
print(f'{heading}:')
print(' ', end='')
print('\n '.join(packages))
print_packages(install_requires, 'install_requires')
print_packages(tests_require, 'tests_require')
print_packages(dev_requires, 'dev_requires')
with TemporaryDirectory() as tmpdir:
check_call(['python3', '-m', 'venv', tmpdir])
check_call([join(tmpdir, 'bin', 'pip'), 'install', *install_requires])
frozen = check_output([join(tmpdir, 'bin', 'pip'), 'freeze'])
frozen = set(frozen.decode('utf-8').split())
check_call([join(tmpdir, 'bin', 'pip'), 'install', *tests_require,
*dev_requires])
dev_frozen = check_output([join(tmpdir, 'bin', 'pip'), 'freeze'])
dev_frozen = set(dev_frozen.decode('utf-8').split()) - frozen
print_packages(frozen, 'frozen')
print_packages(dev_frozen, 'dev_frozen')
with open('requirements.txt', 'w') as fh:
fh.write('\n'.join(sorted(frozen)))
fh.write('\n')
with open('requirements-dev.txt', 'w') as fh:
fh.write('\n'.join(sorted(dev_frozen)))
fh.write('\n')

View File

@@ -62,7 +62,7 @@ setup(
entry_points={ entry_points={
'console_scripts': console_scripts, 'console_scripts': console_scripts,
}, },
install_requires=[ install_requires=(
'PyYaml>=4.2b1', 'PyYaml>=4.2b1',
'dnspython>=1.15.0', 'dnspython>=1.15.0',
'fqdn>=1.5.0', 'fqdn>=1.5.0',
@@ -70,8 +70,8 @@ setup(
'pycountry>=19.8.18', 'pycountry>=19.8.18',
'pycountry-convert>=0.7.2', 'pycountry-convert>=0.7.2',
'python-dateutil>=2.8.1', 'python-dateutil>=2.8.1',
'requests>=2.20.0' 'requests>=2.20.0',
], ),
license='MIT', license='MIT',
long_description=long_description(), long_description=long_description(),
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
@@ -81,7 +81,7 @@ setup(
url='https://github.com/octodns/octodns', url='https://github.com/octodns/octodns',
version=octodns.__VERSION__, version=octodns.__VERSION__,
tests_require=( tests_require=(
'pytest', 'pytest>=6.2.5',
'pytest-network', 'pytest-network>=0.0.1',
), ),
) )

View File

@@ -15,8 +15,8 @@ from octodns.record import Create, Delete, Record
from octodns.yaml import safe_load from octodns.yaml import safe_load
from octodns.zone import Zone from octodns.zone import Zone
from mock import MagicMock, patch
from unittest import TestCase from unittest import TestCase
from unittest.mock import MagicMock, patch
from helpers import DynamicProvider, GeoProvider, NoSshFpProvider, \ from helpers import DynamicProvider, GeoProvider, NoSshFpProvider, \
PlannableProvider, SimpleProvider, TemporaryDirectory PlannableProvider, SimpleProvider, TemporaryDirectory

View File

@@ -6,8 +6,8 @@ from __future__ import absolute_import, division, print_function, \
unicode_literals unicode_literals
from logging import getLogger from logging import getLogger
from mock import MagicMock, call
from unittest import TestCase from unittest import TestCase
from unittest.mock import MagicMock, call
from octodns.processor.base import BaseProcessor from octodns.processor.base import BaseProcessor
from octodns.provider import SupportsException from octodns.provider import SupportsException

View File

@@ -8,10 +8,10 @@ from __future__ import absolute_import, division, print_function, \
import dns.zone import dns.zone
from dns.exception import DNSException from dns.exception import DNSException
from mock import patch
from os.path import exists from os.path import exists
from shutil import copyfile from shutil import copyfile
from unittest import TestCase from unittest import TestCase
from unittest.mock import patch
from octodns.source.axfr import AxfrSource, AxfrSourceZoneTransferFailed, \ from octodns.source.axfr import AxfrSource, AxfrSourceZoneTransferFailed, \
ZoneFileSource, ZoneFileSourceLoadFailure ZoneFileSource, ZoneFileSourceLoadFailure

View File

@@ -1,5 +1,5 @@
from mock import patch
from unittest import TestCase from unittest import TestCase
from unittest.mock import patch
from octodns.source.envvar import EnvVarSource from octodns.source.envvar import EnvVarSource
from octodns.source.envvar import EnvironmentVariableNotFoundException from octodns.source.envvar import EnvironmentVariableNotFoundException