Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drop support for py2/py3 compatible libraries #225

Merged
merged 1 commit into from Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -59,9 +59,7 @@ By the running the `ucc-gen` command, the following steps are executed:

| File Name | Description | Output directory in UCC build |
|----------------------|-------------------------------------|-------------------------------|
| lib/requirements.txt | Python2/Python3 compatible packages | output/<package_ID>/lib |
| lib/py2/requirements.txt | Only Python2 compatible packages | output/<package_ID>/lib/py2 |
| lib/py3/requirements.txt | Only Python3 compatible packages | output/<package_ID>/lib/py3 |
| lib/requirements.txt | Python3 compatible packages | output/<package_ID>/lib |

7. Replace tokens in views.
8. Copy addon's `package/*` to `output/<package_ID>/*` directory.
Expand Down
4 changes: 1 addition & 3 deletions docs/how_to_use.rst
Expand Up @@ -33,9 +33,7 @@ What ucc-gen does
* Collect and install Addon's requirements into :code:`output/<package_ID>/lib` directory of addon's package.
* For the addon's requirements, packages are installed according to following table:

* :code:`lib/requirements.txt` - install Python2/Python3 compatible packages into :code:`output/<package_ID>/lib`
* :code:`lib/py2/requirements.txt` - install Python2 compatible packages into :code:`output/<package_ID>/lib2`
* :code:`lib/py3/requirements.txt` - install Python3 compatible packages into :code:`output/<package_ID>/lib3`
* :code:`lib/requirements.txt` - install Python3 compatible packages into :code:`output/<package_ID>/lib`

* Replace tokens in views.
* Copy addon's :code:`package/*` to :code:`output/<package_ID>/*` directory.
Expand Down
20 changes: 1 addition & 19 deletions splunk_add_on_ucc_framework/__init__.py
Expand Up @@ -297,25 +297,7 @@ def _install_libs(requirements, ucc_target, installer="python3"):
logging.info(f" Uses common requirements")
_install_libs(requirements=os.path.join(os.path.abspath(os.path.join(path, os.pardir)), "requirements.txt"), ucc_target=ucc_lib_target)
else:
logging.info(f" Not using common requirements")

if os.path.exists(os.path.join(path,"lib","py2", "requirements.txt")):
logging.info(f" Uses py2 requirements")
_install_libs(requirements=os.path.join(path,"lib","py2", "requirements.txt"), installer="python2", ucc_target=os.path.join(ucc_lib_target, "py2"))
elif os.path.exists(os.path.join(os.path.abspath(os.path.join(path, os.pardir)), "requirements_py2.txt")):
logging.info(f" Uses py2 requirements")
_install_libs(requirements=os.path.join(os.path.abspath(os.path.join(path, os.pardir)), "requirements_py2.txt"), installer="python2", ucc_target=os.path.join(ucc_lib_target, "py2"))
else:
logging.info(f" Not using py2 requirements")

if os.path.exists(os.path.join(path, "lib","py3","requirements.txt")):
logging.info(f" Uses py3 requirements")
_install_libs(requirements=os.path.join(path,"lib", "py3","requirements.txt"), ucc_target=os.path.join(ucc_lib_target, "py3"))
elif os.path.exists(os.path.join(os.path.abspath(os.path.join(path, os.pardir)), "requirements_py3.txt")):
logging.info(f" Uses py3 requirements")
_install_libs(requirements=os.path.join(os.path.abspath(os.path.join(path, os.pardir)), "requirements_py3.txt"), installer="python3", ucc_target=os.path.join(ucc_lib_target, "py2"))
else:
logging.info(f" Not using py3 requirements")
logging.info(f" Not using common requirements")


def remove_files(path):
Expand Down
1 change: 0 additions & 1 deletion tests/data/package/lib/py2/requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/data/package/lib/py3/requirements.txt

This file was deleted.