Skip to content

Commit

Permalink
Make poetry happy (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: Darren Vengroff <[email protected]>
  • Loading branch information
mikivee and vengroff authored Oct 15, 2024
1 parent 3f019e5 commit d54c23c
Show file tree
Hide file tree
Showing 11 changed files with 9,497 additions and 143 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Run our tests whenever a branch is pushed.

name: Run tests

on:
push:
branches-ignore:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

# See https://github.com/google-github-actions/auth#usage
permissions:
contents: 'read'
id-token: 'write'

steps:
- uses: actions/checkout@v4

# See https://github.com/google-github-actions/auth#usage
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
token_format: 'access_token'
project_id: 'cube-machine-learning'
service_account: '[email protected]'
workload_identity_provider: 'projects/777182164725/locations/global/workloadIdentityPools/github/providers/ra-github-repo'

# We download a lot of dependencies. So free up some space
# by removing tools we don't need.
- name: Free up disk space
run: |
ls -F /opt/hostedtoolcache
df /opt/hostedtoolcache
rm -rf /opt/hostedtoolcache/Java*
rm -rf /opt/hostedtoolcache/Ruby
rm -rf /opt/hostedtoolcache/go
rm -rf /opt/hostedtoolcache/node
df /opt/hostedtoolcache
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install keyring auth
run: |
pip install keyring keyrings-google-artifactregistry-auth
- name: Check keyring
run: |
keyring --list-backends
- name: Install pytest
run: |
pip install pytest
- name: Install dependencies.
run: |
pip install \
--index-url https://us-central1-python.pkg.dev/cube-machine-learning/rewiring-america-python-repo/simple \
--extra-index-url https://pypi.org/simple/ \
--keyring-provider import \
-r ./requirements-test-14.3.txt; \
- name: Test with pytest
run: |
pytest
8,894 changes: 8,894 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Common config file for python tools.

# Poetry

[tool.poetry]
name = "surrogate_modeling"
version = "0.1.0"
description = "Surrogate modeling."
authors = ["Miki Verma <[email protected]>"]
readme = "README.md"
package-mode = false

# The priorities of these are backwards relative to what they should
# actually be. See
# https://www.notion.so/rewiringamerica/Poetry-performance-regression-when-using-private-artifact-repository-21cf6e7c7b4c496ab3526a86e7d7d641?pvs=4
# for details.
[[tool.poetry.source]]
name = "rewiring-america-python-repo"
url = "https://us-central1-python.pkg.dev/cube-machine-learning/rewiring-america-python-repo/simple/"
priority = "supplemental"

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[tool.poetry.dependencies]
python = ">=3.10, <3.11"

# These are RA projects in an internal repo.
dmlutils = "^0.8.0"
dmlbootstrap = "^0.2.0"

# This is to depend on essentially all the pinned
# versions of things found in the Databricks 14.3
# runtime. This means this project should only be
# run on 14.3 runtimes, possibly including the ML
# version. The minor .Z version tacked on the end
# is our internal revision number of the cluster
# libraries.
radbcluster = "==14.3.1"

# These are from PyPi
usingversion = "^0.1.2"

[tool.poetry.group.dev.dependencies]
black = "^22.6.0"
ruff = "^0.5.5"
isort = "^5.13.2"
flake8 = "^6.1.0"
keyrings-google-artifactregistry-auth = "^1.1.2"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.4"
coverage = {extras = ["toml"], version = "^7.6.0"}
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


# Linting tools

[tool.black]
line-length = 120

[tool.isort]
profile = "black"

[tool.ruff.lint]
select = ["D"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.pytest.ini_options]
pythonpath = [
"src"
]
56 changes: 56 additions & 0 deletions requirements-db-14.3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--extra-index-url https://us-central1-python.pkg.dev/cube-machine-learning/rewiring-america-python-repo/simple

appnope==0.1.4 ; python_version >= "3.10" and python_version < "3.11" and (platform_system == "Darwin" or sys_platform == "darwin")
colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.11" and (platform_system == "Windows" or sys_platform == "win32")
cython==0.29.32 ; python_version >= "3.10" and python_version < "3.11"
databricks-connect==13.1.0 ; python_version >= "3.10" and python_version < "3.11"
distro==1.9.0 ; python_version >= "3.10" and python_version < "3.11"
dmlbootstrap==0.1.3 ; python_version >= "3.10" and python_version < "3.11"
dmlutils==0.7.0 ; python_version >= "3.10" and python_version < "3.11"
duckdb==1.1.1 ; python_version >= "3.10" and python_version < "3.11"
et-xmlfile==1.1.0 ; python_version >= "3.10" and python_version < "3.11"
flask==2.2.5 ; python_version >= "3.10" and python_version < "3.11"
fsspec[http]==2023.6.0 ; python_version >= "3.10" and python_version < "3.11"
gcsfs==2023.6.0 ; python_version >= "3.10" and python_version < "3.11"
gitpython==3.1.27 ; python_version >= "3.10" and python_version < "3.11"
google-api-core[grpc]==2.15.0 ; python_version >= "3.10" and python_version < "3.11"
google-cloud-secret-manager==2.20.2 ; python_version >= "3.10" and python_version < "3.11"
googleapis-common-protos[grpc]==1.62.0 ; python_version >= "3.10" and python_version < "3.11"
greenlet==3.1.1 ; python_version >= "3.10" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version < "3.11"
grpc-google-iam-v1==0.13.1 ; python_version >= "3.10" and python_version < "3.11"
imagehash==4.3.1 ; python_version >= "3.10" and python_version < "3.11"
jinja2==3.1.2 ; python_version >= "3.10" and python_version < "3.11"
jupyter-core==5.2.0 ; python_version >= "3.10" and python_version < "3.11"
keyrings-google-artifactregistry-auth==1.1.2 ; python_version >= "3.10" and python_version < "3.11"
lazr-restfulclient==0.14.4 ; python_version >= "3.10" and python_version < "3.11"
lazr-uri==1.0.6 ; python_version >= "3.10" and python_version < "3.11"
lazy-loader==0.3 ; python_version >= "3.10" and python_version < "3.11"
mako==1.2.0 ; python_version >= "3.10" and python_version < "3.11"
markdown==3.4.1 ; python_version >= "3.10" and python_version < "3.11"
markupsafe==2.1.1 ; python_version >= "3.10" and python_version < "3.11"
mlflow-skinny[databricks]==2.9.2 ; python_version >= "3.10" and python_version < "3.11"
notebook-shim==0.2.2 ; python_version >= "3.10" and python_version < "3.11"
openpyxl==3.1.5 ; python_version >= "3.10" and python_version < "3.11"
pillow==9.4.0 ; python_version >= "3.10" and python_version < "3.11"
proto-plus==1.24.0 ; python_version >= "3.10" and python_version < "3.11"
py4j==0.10.9.7 ; python_version >= "3.10" and python_version < "3.11"
py==1.11.0 ; python_version >= "3.10" and python_version < "3.11" and implementation_name == "pypy"
pygments==2.11.2 ; python_version >= "3.10" and python_version < "3.11"
pyjwt==2.3.0 ; python_version >= "3.10" and python_version < "3.11"
pynacl==1.5.0 ; python_version >= "3.10" and python_version < "3.11"
pyspark==3.5.3 ; python_version >= "3.10" and python_version < "3.11"
pytoolconfig[global]==1.2.5 ; python_version >= "3.10" and python_version < "3.11"
pywavelets==1.4.1 ; python_version >= "3.10" and python_version < "3.11"
pywin32-ctypes==0.2.3 ; python_version >= "3.10" and python_version < "3.11" and sys_platform == "win32"
pywin32==307 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.10" and python_version < "3.11"
pywinpty==2.0.13 ; python_version >= "3.10" and python_version < "3.11" and os_name == "nt"
pyyaml==6.0 ; python_version >= "3.10" and python_version < "3.11"
radbcluster==14.3.1 ; python_version >= "3.10" and python_version < "3.11"
secretstorage==3.3.1 ; python_version >= "3.10" and python_version < "3.11"
send2trash==1.8.0 ; python_version >= "3.10" and python_version < "3.11"
sqlalchemy==1.4.39 ; python_version >= "3.10" and python_version < "3.11"
toml==0.10.2 ; python_version >= "3.10" and python_version < "3.11"
typing-extensions==4.4.0 ; python_version >= "3.10" and python_version < "3.11"
usingversion==0.1.2 ; python_version >= "3.10" and python_version < "3.11"
visions[type-image-path]==0.7.5 ; python_version >= "3.10" and python_version < "3.11"
werkzeug==2.2.2 ; python_version >= "3.10" and python_version < "3.11"
Loading

0 comments on commit d54c23c

Please sign in to comment.