Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Modernize install (#76021)
Co-authored-by: Matt Clay <matt@mystile.com> Co-authored-by: Matt Davis <mrd@redhat.com> Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
- Loading branch information
Showing
51 changed files
with
538 additions
and
642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
../lib/ansible/cli/scripts/ansible_cli_stub.py | ||
../lib/ansible/cli/adhoc.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/console.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/doc.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/galaxy.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/inventory.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/playbook.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/pull.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1 +1 @@ | ||
ansible | ||
../lib/ansible/cli/vault.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
minor_changes: | ||
- Installation - modernize our python installation, to reduce dynamic code in setup.py, and migrate | ||
what is feasible to setup.cfg. This will enable shipping wheels in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,41 @@ | ||
# Copyright: (c) 2021, Matt Martz <matt@sivel.net> | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
import argparse | ||
import importlib | ||
import os | ||
import sys | ||
|
||
from importlib.metadata import distribution | ||
|
||
|
||
def _short_name(name): | ||
return name.replace('ansible-', '').replace('ansible', 'adhoc') | ||
|
||
|
||
def main(): | ||
dist = distribution('ansible-core') | ||
ep_map = {_short_name(ep.name): ep for ep in dist.entry_points if ep.group == 'console_scripts'} | ||
|
||
parser = argparse.ArgumentParser(prog='python -m ansible', add_help=False) | ||
parser.add_argument('entry_point', choices=list(ep_map) + ['test']) | ||
args, extra = parser.parse_known_args() | ||
|
||
if args.entry_point == 'test': | ||
ansible_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
source_root = os.path.join(ansible_root, 'test', 'lib') | ||
|
||
if os.path.exists(os.path.join(source_root, 'ansible_test', '_internal', '__init__.py')): | ||
# running from source, use that version of ansible-test instead of any version that may already be installed | ||
sys.path.insert(0, source_root) | ||
|
||
module = importlib.import_module('ansible_test._util.target.cli.ansible_test_cli_stub') | ||
main = module.main | ||
else: | ||
main = ep_map[args.entry_point].load() | ||
|
||
main([args.entry_point] + extra) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.