Skip to content

Commit

Permalink
Ensure correct directory is set for pep517 calls
Browse files Browse the repository at this point in the history
  • Loading branch information
stealthycoin committed Sep 28, 2022
1 parent 02331a7 commit 118333a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/backends/build_system/functional/test_aws_cli_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import contextlib
import re
import os
import sys
Expand All @@ -29,6 +30,16 @@
ROOT_DIR = pathlib.Path(__file__).parents[4]


@contextlib.contextmanager
def cd(dirname):
original = os.getcwd()
os.chdir(dirname)
try:
yield
finally:
os.chdir(original)


@pytest.fixture(scope="session")
def venv_path(tmp_path_factory):
return tmp_path_factory.mktemp("venv")
Expand All @@ -54,8 +65,9 @@ def _normalize_dist_info_name(self, name: str) -> str:
name = name.lower()
return name

def _get_install_requires(self):
requires = flit_core.buildapi.get_requires_for_build_wheel()
def _get_install_requires(self, root_):
with cd(ROOT_DIR):
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
Expand Down

0 comments on commit 118333a

Please sign in to comment.