Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
stealthycoin committed Sep 25, 2022
1 parent e3541ce commit 1e1f8cb
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 12 deletions.
20 changes: 16 additions & 4 deletions backends/build_system/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,34 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
import re
import json
import shutil
import subprocess
import venv
from typing import List, Dict, Any

from setuptools.config import read_configuration
import flit_core.buildapi
from distutils.dir_util import copy_tree

from constants import ROOT_DIR


def get_install_requires():
return read_configuration(os.path.join(ROOT_DIR, "setup.cfg"))["options"][
"install_requires"
]
requires = flit_core.buildapi.get_requires_for_build_wheel()
# Generation of the auto-complete index requires importing from the
# awscli package and iterating over the commands from the clidriver. In
# order to be able to do this, it requires all of the CLI's runtime
# dependencies to be present to avoid import errors.
dependency_block_re = re.compile(
r"dependencies = \[([\s\S]+?)\]", re.MULTILINE
)
extract_dependencies_re = re.compile(r'"(.+)"')
with open(ROOT_DIR / "pyproject.toml", "r") as f:
data = f.read()
raw_dependencies = dependency_block_re.findall(data)[0]
dependencies = extract_dependencies_re.findall(raw_dependencies)
return dependencies


class Utils:
Expand Down
46 changes: 43 additions & 3 deletions requirements/bootstrap-lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@
#
# pip-compile --allow-unsafe --generate-hashes --output-file=/Users/jcarlyl/aws-code/aws-cli/requirements/bootstrap-lock.txt /Users/jcarlyl/aws-code/aws-cli/requirements/bootstrap.txt
#
certifi==2022.9.24 \
--hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \
--hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
# via requests
charset-normalizer==2.1.1 \
--hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \
--hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f
# via requests
docutils==0.19 \
--hash=sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6 \
--hash=sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc
# via flit
flit==3.7.1 \
--hash=sha256:06a93a6737fa9380ba85fe8d7f28efb6c93c4f4ee9c7d00cc3375a81f33b91a4 \
--hash=sha256:3c9bd9c140515bfe62dd938c6610d10d6efb9e35cc647fc614fe5fb3a5036682
# via -r /Users/jcarlyl/aws-code/aws-cli/requirements/bootstrap.txt
flit-core==3.7.1 \
--hash=sha256:14955af340c43035dbfa96b5ee47407e377ee337f69e70f73064940d27d0a44f \
--hash=sha256:e454fdbf68c7036e1c7435ec7479383f9d9a1650ca5b304feb184eba1efcdcef
# via flit
idna==3.4 \
--hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \
--hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2
# via requests
requests==2.28.1 \
--hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \
--hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349
# via flit
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via flit
tomli-w==1.0.0 \
--hash=sha256:9f2a07e8be30a0729e533ec968016807069991ae2fd921a78d42f429ae5f4463 \
--hash=sha256:f463434305e0336248cac9c2dc8076b707d8a12d019dd349f5c1e382dd1ae1b9
# via flit
urllib3==1.26.12 \
--hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \
--hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997
# via requests
wheel==0.37.1 \
--hash=sha256:4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a \
--hash=sha256:e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4
Expand All @@ -14,7 +54,7 @@ pip==22.2.2 \
--hash=sha256:3fd1929db052f056d7a998439176d3333fa1b3f6c1ad881de1885c0717608a4b \
--hash=sha256:b61a374b5bc40a6e982426aede40c9b5a08ff20e640f5b56977f4f91fed1e39a
# via -r /Users/jcarlyl/aws-code/aws-cli/requirements/bootstrap.txt
setuptools==57.5.0 \
--hash=sha256:60d78588f15b048f86e35cdab73003d8b21dd45108ee61a6693881a427f22073 \
--hash=sha256:d9d3266d50f59c6967b9312844470babbdb26304fe740833a5f8d89829ba3a24
setuptools==65.3.0 \
--hash=sha256:2e24e0bec025f035a2e72cdd1961119f557d78ad331bb00ff82efb2ab8da8e82 \
--hash=sha256:7732871f4f7fa58fb6bdcaeadb0161b2bd046c85905dbaa066bdcbcc81953b57
# via -r /Users/jcarlyl/aws-code/aws-cli/requirements/bootstrap.txt
3 changes: 2 additions & 1 deletion requirements/bootstrap.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pip>=22.0.0,<23.0.0
setuptools==57.5.0
setuptools==65.3.0
wheel>=0.37.1
flit==3.7.1
19 changes: 15 additions & 4 deletions tests/backends/build_system/functional/test_aws_cli_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import subprocess

import pytest
from setuptools.config import read_configuration
import flit_core.buildapi

from build_system.awscli_venv import AwsCliVenv
from build_system.constants import ArtifactType
Expand Down Expand Up @@ -55,9 +55,20 @@ def _normalize_dist_info_name(self, name: str) -> str:
return name

def _get_install_requires(self):
return read_configuration(os.path.join(ROOT_DIR, "setup.cfg"))[
"options"
]["install_requires"]
requires = flit_core.buildapi.get_requires_for_build_wheel()
# Generation of the auto-complete index requires importing from the
# awscli package and iterating over the commands from the clidriver. In
# order to be able to do this, it requires all of the CLI's runtime
# dependencies to be present to avoid import errors.
dependency_block_re = re.compile(
r"dependencies = \[([\s\S]+?)\]", re.MULTILINE
)
extract_dependencies_re = re.compile(r'"(.+)"')
with open(ROOT_DIR / "pyproject.toml", "r") as f:
data = f.read()
raw_dependencies = dependency_block_re.findall(data)[0]
dependencies = extract_dependencies_re.findall(raw_dependencies)
return dependencies

def _python_version(self) -> str:
info = sys.version_info
Expand Down

0 comments on commit 1e1f8cb

Please sign in to comment.