Skip to content

Commit

Permalink
Issue #119: Use pip-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekmo committed Aug 8, 2023
1 parent fd05294 commit 008267d
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 41 deletions.
3 changes: 0 additions & 3 deletions py2-requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion py3-requirements.txt

This file was deleted.

8 changes: 8 additions & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-r requirements.in
Sphinx
sphinx-click
codecov>=1.4.0
mock
pyfakefs
requests-mock
tox
138 changes: 128 additions & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,128 @@
Sphinx
sphinx-click
codecov>=1.4.0
mock
pyfakefs
requests-mock
google
futures; python_version < '3'
py2-ipaddress; python_version < '3'
-rcommon-requirements.txt
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements-dev.in
#
alabaster==0.7.13
# via sphinx
babel==2.12.1
# via sphinx
beautifulsoup4==4.12.2
# via
# -r requirements.in
# google
# proxy-db
cachetools==5.3.1
# via tox
certifi==2023.7.22
# via requests
chardet==5.2.0
# via tox
charset-normalizer==3.2.0
# via requests
click==7.1.2
# via
# -r requirements.in
# proxy-db
# sphinx-click
codecov==2.1.13
# via -r requirements-dev.in
colorama==0.4.6
# via
# -r requirements.in
# tox
coverage==7.2.7
# via codecov
distlib==0.3.7
# via virtualenv
docutils==0.20.1
# via
# sphinx
# sphinx-click
filelock==3.12.2
# via
# tox
# virtualenv
google==3.0.0
# via -r requirements.in
greenlet==2.0.2
# via sqlalchemy
humanize==4.7.0
# via -r requirements.in
idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
markupsafe==2.1.3
# via jinja2
mock==5.1.0
# via -r requirements-dev.in
packaging==23.1
# via
# pyproject-api
# sphinx
# tox
platformdirs==3.10.0
# via
# tox
# virtualenv
pluggy==1.2.0
# via tox
proxy-db==0.3.1
# via -r requirements.in
pyfakefs==5.2.3
# via -r requirements-dev.in
pygments==2.16.1
# via sphinx
pyproject-api==1.5.3
# via tox
requests==2.31.0
# via
# -r requirements.in
# codecov
# proxy-db
# requests-mock
# sphinx
requests-mock==1.11.0
# via
# -r requirements-dev.in
# -r requirements.in
six==1.16.0
# via
# proxy-db
# requests-mock
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4.1
# via beautifulsoup4
sphinx==7.1.2
# via
# -r requirements-dev.in
# sphinx-click
sphinx-click==4.4.0
# via -r requirements-dev.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sqlalchemy==2.0.19
# via proxy-db
tox==4.6.4
# via -r requirements-dev.in
typing-extensions==4.7.1
# via sqlalchemy
urllib3==2.0.4
# via requests
virtualenv==20.24.2
# via tox
10 changes: 10 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
beautifulsoup4
requests
click<8
humanize
colorama
requests-mock
google
proxy-db
futures; python_version < '3.0'
py2-ipaddress; python_version < '3.0'
50 changes: 50 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile
#
beautifulsoup4==4.12.2
# via
# -r requirements.in
# google
# proxy-db
certifi==2023.7.22
# via requests
charset-normalizer==3.2.0
# via requests
click==7.1.2
# via
# -r requirements.in
# proxy-db
colorama==0.4.6
# via -r requirements.in
google==3.0.0
# via -r requirements.in
greenlet==2.0.2
# via sqlalchemy
humanize==4.7.0
# via -r requirements.in
idna==3.4
# via requests
proxy-db==0.3.1
# via -r requirements.in
requests==2.31.0
# via
# -r requirements.in
# proxy-db
# requests-mock
requests-mock==1.11.0
# via -r requirements.in
six==1.16.0
# via
# proxy-db
# requests-mock
soupsieve==2.4.1
# via beautifulsoup4
sqlalchemy==2.0.19
# via proxy-db
typing-extensions==4.7.1
# via sqlalchemy
urllib3==2.0.4
# via requests
30 changes: 3 additions & 27 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
# Información del paquete
PACKAGE_NAME = 'dirhunt'
PACKAGE_DOWNLOAD_URL = 'https://github.com/Nekmo/dirhunt/archive/master.zip' # .tar.gz
REQUIREMENTS_FILES = [
{'name': 'common-requirements.txt'},
{'name': 'py2-requirements.txt', 'marker': 'python_version<"3.0"', "include": sys.version_info < (3,0)},
{'name': 'py3-requirements.txt', 'marker': 'python_version>"3.0"', "include": sys.version_info > (3,0)},
]
REQUIREMENTS_FILE = 'requirements.in'
URL = 'https://github.com/Nekmo/dirhunt'
STATUS_LEVEL = 3 # 1:Planning 2:Pre-Alpha 3:Alpha 4:Beta 5:Production/Stable 6:Mature 7:Inactive
KEYWORDS = ['directories', 'websec', 'pentesting', 'security-audit'] # Palabras clave
Expand Down Expand Up @@ -174,28 +170,8 @@ def find_package_data(where='.', package='',
##############################################################################

def read_requirements_file(path):
if not os.path.lexists(path):
return
with open(path) as f:
lines = f.readlines()
for line in lines:
line = line.split('#', 1)[0]
line = line.strip()
if line.startswith('-'):
continue
yield line


def read_requirements_files(files):
reqs = []
for file in files:
if LooseVersion(setuptool_version) >= LooseVersion('20.2'):
reqs.extend([('{};{}'.format(req, file['marker']) if file.get('marker') else req)
for req in read_requirements_file(file['name'])])
elif file.get('include', True):
# Retrocompatibility mode for setuptools < 20.2
reqs.extend(list(read_requirements_file(file['name'])))
return reqs
return f.readlines()


# Todos los módulos y submódulos a instalar (module, module.submodule, module.submodule2...)
Expand Down Expand Up @@ -291,7 +267,7 @@ def frange(x, y, jump):
platforms=PLATFORMS,

provides=modules,
install_requires=read_requirements_files(REQUIREMENTS_FILES),
install_requires=read_requirements_file(REQUIREMENTS_FILE),

packages=packages,
include_package_data=True,
Expand Down

0 comments on commit 008267d

Please sign in to comment.