Skip to content

Commit 08fe090

Browse files
feat: migrating off of circle/ci (#638)
* saving state of noxfile prior to owlbot.py edits * minor clean up of leftover artifacts from various experiments * linting and black * adds noxfile.py to excludes and removes noxfile edits in owlbot * Adds new kokoro file in presubmit * removes circle/ci config file * Update noxfile.py * Update noxfile.py * Update noxfile.py * remove limit on printing only KOKORO env variables (for testing) * updates build.sh with conda environmental variables * updates build.sh with conda environmental variables redux * removes the ci folder and files related to circle ci * updates env variable to display all vars not just KOKORO * removes additional content related to circle ci * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * updates owlbot with build.sh edits * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * updates owlbot with build.sh minor tweak * revert build.sh * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * testing regex change * revert build.sh * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 7fab432 commit 08fe090

12 files changed

+123
-238
lines changed

.circleci/config.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.kokoro/build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ cd "${PROJECT_ROOT}"
2323

2424
# Disable buffering, so that the logs stream through.
2525
export PYTHONUNBUFFERED=1
26+
export CONDA_EXE=/root/conda/bin/conda
27+
export CONDA_PREFIX=/root/conda
28+
export CONDA_PROMPT_MODIFIER=(base)
29+
export _CE_CONDA=
30+
export CONDA_SHLVL=1
31+
export CONDA_PYTHON_EXE=/root/conda/bin/python
32+
export CONDA_DEFAULT_ENV=base
33+
export PATH=/root/conda/bin:/root/conda/condabin:${PATH}
34+
2635

2736
# Debug: show build environment
28-
env | grep KOKORO
37+
env
2938

3039
# Setup service account credentials.
3140
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json

.kokoro/presubmit/conda_test.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "conda_test"
7+
}

ci/config_auth.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

ci/requirements-3.7-0.24.2.conda

Lines changed: 0 additions & 17 deletions
This file was deleted.

ci/requirements-3.9-1.3.4.conda

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/run_conda.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

ci/run_tests.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

noxfile.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
DEFAULT_PYTHON_VERSION = "3.8"
3333

34+
3435
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
3536
UNIT_TEST_STANDARD_DEPENDENCIES = [
3637
"mock",
@@ -51,6 +52,11 @@
5152
"3.9": [],
5253
}
5354

55+
CONDA_TEST_PYTHON_VERSIONS = [
56+
UNIT_TEST_PYTHON_VERSIONS[0],
57+
UNIT_TEST_PYTHON_VERSIONS[-1],
58+
]
59+
5460
SYSTEM_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
5561
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5662
"mock",
@@ -514,3 +520,78 @@ def prerelease_deps(session):
514520
system_test_folder_path,
515521
*session.posargs,
516522
)
523+
524+
525+
def install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages):
526+
"""Installs packages from conda forge, pypi, and locally."""
527+
528+
# Install from conda-forge and default conda package repos.
529+
session.conda_install(*conda_forge_packages, channel=["defaults", "conda-forge"])
530+
531+
# Install from pypi for packages not readily available on conda forge.
532+
session.install(
533+
*standard_deps,
534+
)
535+
536+
# Install via pip from the local repo, avoid doing dependency resolution
537+
# via pip, so that we don't override any conda resolved dependencies
538+
session.install("-e", ".", "--no-deps")
539+
540+
541+
@nox.session(python=CONDA_TEST_PYTHON_VERSIONS, venv_backend="mamba")
542+
def conda_test(session):
543+
"""Run test suite in a conda virtual environment.
544+
545+
Installs all test dependencies, then installs this package.
546+
NOTE: Some of these libraries are not readily available on conda-forge
547+
at this time and are thus installed using pip after the base install of
548+
libraries from conda-forge.
549+
550+
We decided that it was more important to prove a base ability to install
551+
using conda than to complicate things with adding a whole nother
552+
set of constraints just for a conda install, so this install does not
553+
attempt to constrain packages (i.e. in a constraints-x.x.txt file)
554+
manually.
555+
"""
556+
557+
standard_deps = (
558+
UNIT_TEST_STANDARD_DEPENDENCIES
559+
+ UNIT_TEST_DEPENDENCIES
560+
+ UNIT_TEST_EXTERNAL_DEPENDENCIES
561+
)
562+
563+
conda_forge_packages = [
564+
"db-dtypes",
565+
"google-api-core",
566+
"google-auth",
567+
"google-auth-oauthlib",
568+
"google-cloud-bigquery",
569+
"google-cloud-bigquery-storage",
570+
"numpy",
571+
"pandas",
572+
"pyarrow",
573+
"pydata-google-auth",
574+
"tqdm",
575+
"protobuf",
576+
]
577+
578+
install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages)
579+
580+
# Provide a list of all installed packages (both from conda forge and pip)
581+
# for troubleshooting purposes.
582+
session.run("mamba", "list")
583+
584+
# Tests are limited to unit tests only, at this time.
585+
session.run(
586+
"py.test",
587+
"--quiet",
588+
f"--junitxml=unit_{session.python}_sponge_log.xml",
589+
"--cov=pandas_gbq",
590+
"--cov=tests/unit",
591+
"--cov-append",
592+
"--cov-config=.coveragerc",
593+
"--cov-report=",
594+
"--cov-fail-under=0",
595+
os.path.join("tests", "unit"),
596+
*session.posargs,
597+
)

0 commit comments

Comments
 (0)