Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Check for more CI environments #931

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion lamindb_setup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,36 @@
from ._setup_user import login, logout
from .core._settings import settings

_TESTING = _os.getenv("LAMIN_TESTING") is not None

def _is_CI_environment() -> bool:
ci_env_vars = [
"LAMIN_TESTING", # Set by our nox configurations
"CI", # Commonly set by many CI systems
"TRAVIS", # Travis CI
"GITHUB_ACTIONS", # GitHub Actions
"GITLAB_CI", # GitLab CI/CD
"CIRCLECI", # CircleCI
"JENKINS_URL", # Jenkins
"TEAMCITY_VERSION", # TeamCity
"BUILDKITE", # Buildkite
"BITBUCKET_BUILD_NUMBER", # Bitbucket Pipelines
"APPVEYOR", # AppVeyor
"AZURE_HTTP_USER_AGENT", # Azure Pipelines
"BUDDY", # Buddy
"DRONE", # Drone CI
"HUDSON_URL", # Hudson
"CF_BUILD_ID", # Codefresh
"WERCKER", # Wercker
"NOW_BUILDER", # ZEIT Now
"TASKCLUSTER_ROOT_URL", # TaskCluster
"SEMAPHORE", # Semaphore CI
"BUILD_ID", # Generic build environments
]
return any(env_var in _os.environ for env_var in ci_env_vars)


_TESTING = _is_CI_environment()


# hide the supabase error in a thread on windows
if _os.name == "nt":
Expand Down
Loading