Skip to content

Commit 97ddc8a

Browse files
reconfigure prerelease pip installs
1 parent 829d77d commit 97ddc8a

File tree

1 file changed

+12
-58
lines changed

1 file changed

+12
-58
lines changed

noxfile.py

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import multiprocessing
2121
import os
2222
import pathlib
23-
import re
2423
import shutil
2524
import time
2625
from typing import Dict, List
@@ -583,11 +582,13 @@ def prerelease(session: nox.sessions.Session, tests_path, extra_pytest_options=(
583582
constraints_path = str(
584583
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
585584
)
586-
587-
# Ignore officially released versions of certain packages specified in
588-
# testing/constraints-*.txt and install a more recent, pre-release versions
589-
# directly
590-
already_installed = set()
585+
session.install(
586+
*set(UNIT_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_STANDARD_DEPENDENCIES),
587+
"-c",
588+
constraints_path,
589+
"-e",
590+
".",
591+
)
591592

592593
# PyArrow prerelease packages are published to an alternative PyPI host.
593594
# https://arrow.apache.org/docs/python/install.html#installing-nightly-packages
@@ -598,10 +599,6 @@ def prerelease(session: nox.sessions.Session, tests_path, extra_pytest_options=(
598599
"--pre",
599600
"--upgrade",
600601
"pyarrow",
601-
)
602-
already_installed.add("pyarrow")
603-
604-
session.install(
605602
"--prefer-binary",
606603
"--pre",
607604
"--upgrade",
@@ -610,62 +607,19 @@ def prerelease(session: nox.sessions.Session, tests_path, extra_pytest_options=(
610607
# https://github.com/googleapis/python-bigquery-dataframes/pull/268#discussion_r1423205172
611608
# "pandas!=2.1.4, !=2.2.0rc0, !=2.2.0, !=2.2.1",
612609
"pandas",
613-
)
614-
already_installed.add("pandas")
615-
616-
# Workaround https://github.com/googleapis/python-db-dtypes-pandas/issues/178
617-
session.install("--no-deps", "db-dtypes")
618-
already_installed.add("db-dtypes")
619-
620-
# Ensure we catch breaking changes in the client libraries early.
621-
session.install(
610+
# Workaround https://github.com/googleapis/python-db-dtypes-pandas/issues/178
611+
"--no-deps",
612+
"db-dtypes",
613+
# Ensure we catch breaking changes in the client libraries early.
622614
"--upgrade",
623615
"git+https://github.com/googleapis/python-bigquery.git#egg=google-cloud-bigquery",
624-
)
625-
already_installed.add("google-cloud-bigquery")
626-
session.install(
627616
"--upgrade",
628617
"-e",
629618
"git+https://github.com/googleapis/google-cloud-python.git#egg=google-cloud-bigquery-storage&subdirectory=packages/google-cloud-bigquery-storage",
630-
)
631-
already_installed.add("google-cloud-bigquery-storage")
632-
session.install(
633619
"--upgrade",
634620
"git+https://github.com/googleapis/python-bigquery-pandas.git#egg=pandas-gbq",
621+
"--no-deps",
635622
)
636-
already_installed.add("pandas-gbq")
637-
638-
session.install(
639-
*set(UNIT_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_STANDARD_DEPENDENCIES),
640-
"-c",
641-
constraints_path,
642-
)
643-
644-
# Because we test minimum dependency versions on the minimum Python
645-
# version, the first version we test with in the unit tests sessions has a
646-
# constraints file containing all dependencies and extras.
647-
with open(
648-
CURRENT_DIRECTORY / "testing" / f"constraints-{DEFAULT_PYTHON_VERSION}.txt",
649-
encoding="utf-8",
650-
) as constraints_file:
651-
constraints_text = constraints_file.read()
652-
653-
# Ignore leading whitespace and comment lines.
654-
deps = [
655-
match.group(1)
656-
for match in re.finditer(
657-
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
658-
)
659-
if match.group(1) not in already_installed
660-
]
661-
662-
print(already_installed)
663-
664-
# We use --no-deps to ensure that pre-release versions aren't overwritten
665-
# by the version ranges in setup.py.
666-
if deps:
667-
session.install(*deps)
668-
session.install("--no-deps", "-e", ".")
669623

670624
# Print out prerelease package versions.
671625
session.run("python", "-m", "pip", "freeze")

0 commit comments

Comments
 (0)