Skip to content

Commit

Permalink
feat: migrating off of circle/ci (#638)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
chalmerlowe and gcf-owl-bot[bot] committed Jul 14, 2023
1 parent 7fab432 commit 08fe090
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 238 deletions.
34 changes: 0 additions & 34 deletions .circleci/config.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .kokoro/build.sh
Expand Up @@ -23,9 +23,18 @@ cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
export CONDA_EXE=/root/conda/bin/conda
export CONDA_PREFIX=/root/conda
export CONDA_PROMPT_MODIFIER=(base)
export _CE_CONDA=
export CONDA_SHLVL=1
export CONDA_PYTHON_EXE=/root/conda/bin/python
export CONDA_DEFAULT_ENV=base
export PATH=/root/conda/bin:/root/conda/condabin:${PATH}


# Debug: show build environment
env | grep KOKORO
env

# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
Expand Down
7 changes: 7 additions & 0 deletions .kokoro/presubmit/conda_test.cfg
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "conda_test"
}
13 changes: 0 additions & 13 deletions ci/config_auth.sh

This file was deleted.

17 changes: 0 additions & 17 deletions ci/requirements-3.7-0.24.2.conda

This file was deleted.

14 changes: 0 additions & 14 deletions ci/requirements-3.9-1.3.4.conda

This file was deleted.

23 changes: 0 additions & 23 deletions ci/run_conda.sh

This file was deleted.

15 changes: 0 additions & 15 deletions ci/run_tests.sh

This file was deleted.

81 changes: 81 additions & 0 deletions noxfile.py
Expand Up @@ -31,6 +31,7 @@

DEFAULT_PYTHON_VERSION = "3.8"


UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand All @@ -51,6 +52,11 @@
"3.9": [],
}

CONDA_TEST_PYTHON_VERSIONS = [
UNIT_TEST_PYTHON_VERSIONS[0],
UNIT_TEST_PYTHON_VERSIONS[-1],
]

SYSTEM_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down Expand Up @@ -514,3 +520,78 @@ def prerelease_deps(session):
system_test_folder_path,
*session.posargs,
)


def install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages):
"""Installs packages from conda forge, pypi, and locally."""

# Install from conda-forge and default conda package repos.
session.conda_install(*conda_forge_packages, channel=["defaults", "conda-forge"])

# Install from pypi for packages not readily available on conda forge.
session.install(
*standard_deps,
)

# Install via pip from the local repo, avoid doing dependency resolution
# via pip, so that we don't override any conda resolved dependencies
session.install("-e", ".", "--no-deps")


@nox.session(python=CONDA_TEST_PYTHON_VERSIONS, venv_backend="mamba")
def conda_test(session):
"""Run test suite in a conda virtual environment.
Installs all test dependencies, then installs this package.
NOTE: Some of these libraries are not readily available on conda-forge
at this time and are thus installed using pip after the base install of
libraries from conda-forge.
We decided that it was more important to prove a base ability to install
using conda than to complicate things with adding a whole nother
set of constraints just for a conda install, so this install does not
attempt to constrain packages (i.e. in a constraints-x.x.txt file)
manually.
"""

standard_deps = (
UNIT_TEST_STANDARD_DEPENDENCIES
+ UNIT_TEST_DEPENDENCIES
+ UNIT_TEST_EXTERNAL_DEPENDENCIES
)

conda_forge_packages = [
"db-dtypes",
"google-api-core",
"google-auth",
"google-auth-oauthlib",
"google-cloud-bigquery",
"google-cloud-bigquery-storage",
"numpy",
"pandas",
"pyarrow",
"pydata-google-auth",
"tqdm",
"protobuf",
]

install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages)

# Provide a list of all installed packages (both from conda forge and pip)
# for troubleshooting purposes.
session.run("mamba", "list")

# Tests are limited to unit tests only, at this time.
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=pandas_gbq",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
os.path.join("tests", "unit"),
*session.posargs,
)

0 comments on commit 08fe090

Please sign in to comment.