mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Keep awxkit's requirements on the setup.py
awxkit's setup.py was making use of pip internal structures to parse the requirements.txt file. This is not a good thing as they may change, actually that just happened. To avoid this in the future, move the list of requirements to setup.py and make requirements.txt list `.` as the only item. This way we keep a single place to update requirements in the future and avoid accessing pip's internals.
This commit is contained in:
parent
5e223db945
commit
5c91f66316
@ -1,2 +1 @@
|
|||||||
PyYAML
|
.
|
||||||
requests
|
|
||||||
|
|||||||
@ -2,12 +2,6 @@ import os
|
|||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
from setuptools import setup, find_packages, Command
|
from setuptools import setup, find_packages, Command
|
||||||
try: # for pip >= 10
|
|
||||||
from pip._internal.req import parse_requirements
|
|
||||||
except ImportError: # for pip <= 9.0.3
|
|
||||||
from pip.req import parse_requirements
|
|
||||||
|
|
||||||
requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
|
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
@ -66,7 +60,10 @@ setup(
|
|||||||
'clean': CleanCommand,
|
'clean': CleanCommand,
|
||||||
},
|
},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=requirements,
|
install_requires=[
|
||||||
|
'PyYAML',
|
||||||
|
'requests',
|
||||||
|
],
|
||||||
python_requires=">=3.6",
|
python_requires=">=3.6",
|
||||||
extras_require={
|
extras_require={
|
||||||
'formatting': ['jq'],
|
'formatting': ['jq'],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user