Skip to content

Commit

Permalink
Fixed example using release version instead of local one by default (s…
Browse files Browse the repository at this point in the history
…pietras#33)

* update rules_python version to 0.5.0 in example

* use local_repository as default in example

* update rules_python version to 0.5.0 in tests

* formatting
  • Loading branch information
yibum authored Nov 19, 2021
1 parent a79182d commit 269657d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 134 deletions.
64 changes: 14 additions & 50 deletions example/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,62 +1,26 @@
### RULES_PYTHON ###

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_PYTHON_NAME = "rules_python"

RULES_PYTHON_TAG = "0.4.0"

RULES_PYTHON_SHA = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea"

RULES_PYTHON_REPO = "bazelbuild"

RULES_PYTHON_ARCHIVE = "tar.gz"

RULES_PYTHON_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_PYTHON_NAME,
archive = RULES_PYTHON_ARCHIVE,
repo = RULES_PYTHON_REPO,
tag = RULES_PYTHON_TAG,
)

# use http_archive rule to load rules_python repo
### RULES_PYTHON ###
http_archive(
name = RULES_PYTHON_NAME,
sha256 = RULES_PYTHON_SHA,
url = RULES_PYTHON_URL,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

### RULES_CONDA ###

# use this instead of http_archive if you cloned the repo and want to use the local version
#local_repository(
# name = "rules_conda",
# path = "../",
#)

RULES_CONDA_NAME = "rules_conda"

RULES_CONDA_TAG = "0.0.6"

RULES_CONDA_SHA = "c5ad3a077bddff381790d64dd9cc1516b8133c1d695eb3eff4fed04a39dc4522"

RULES_CONDA_REPO = "spietras"

RULES_CONDA_ARCHIVE = "zip"

RULES_CONDA_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_CONDA_NAME,
archive = RULES_CONDA_ARCHIVE,
repo = RULES_CONDA_REPO,
tag = RULES_CONDA_TAG,
local_repository(
name = "rules_conda",
path = "../",
)

# use http_archive rule to load rules_conda repo
http_archive(
name = RULES_CONDA_NAME,
sha256 = RULES_CONDA_SHA,
url = RULES_CONDA_URL,
)
# use this instead of local_repository if you want to use the release version
# keep in mind that there may be differences between them
#http_archive(
# name = "rules_conda",
# sha256 = "c5ad3a077bddff381790d64dd9cc1516b8133c1d695eb3eff4fed04a39dc4522",
# url = "https://github.com/spietras/rules_conda/releases/download/0.0.6/rules_conda-0.0.6.zip"
#)

load("@rules_conda//:defs.bzl", "conda_create", "load_conda", "register_toolchain")

Expand Down
24 changes: 3 additions & 21 deletions tests/miniconda/conda/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_PYTHON_NAME = "rules_python"

RULES_PYTHON_TAG = "0.4.0"

RULES_PYTHON_SHA = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea"

RULES_PYTHON_REPO = "bazelbuild"

RULES_PYTHON_ARCHIVE = "tar.gz"

RULES_PYTHON_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_PYTHON_NAME,
archive = RULES_PYTHON_ARCHIVE,
repo = RULES_PYTHON_REPO,
tag = RULES_PYTHON_TAG,
)

http_archive(
name = RULES_PYTHON_NAME,
sha256 = RULES_PYTHON_SHA,
url = RULES_PYTHON_URL,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

local_repository(
Expand Down
24 changes: 3 additions & 21 deletions tests/miniconda/mamba/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_PYTHON_NAME = "rules_python"

RULES_PYTHON_TAG = "0.4.0"

RULES_PYTHON_SHA = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea"

RULES_PYTHON_REPO = "bazelbuild"

RULES_PYTHON_ARCHIVE = "tar.gz"

RULES_PYTHON_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_PYTHON_NAME,
archive = RULES_PYTHON_ARCHIVE,
repo = RULES_PYTHON_REPO,
tag = RULES_PYTHON_TAG,
)

http_archive(
name = RULES_PYTHON_NAME,
sha256 = RULES_PYTHON_SHA,
url = RULES_PYTHON_URL,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

local_repository(
Expand Down
24 changes: 3 additions & 21 deletions tests/miniforge/conda/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_PYTHON_NAME = "rules_python"

RULES_PYTHON_TAG = "0.4.0"

RULES_PYTHON_SHA = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea"

RULES_PYTHON_REPO = "bazelbuild"

RULES_PYTHON_ARCHIVE = "tar.gz"

RULES_PYTHON_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_PYTHON_NAME,
archive = RULES_PYTHON_ARCHIVE,
repo = RULES_PYTHON_REPO,
tag = RULES_PYTHON_TAG,
)

http_archive(
name = RULES_PYTHON_NAME,
sha256 = RULES_PYTHON_SHA,
url = RULES_PYTHON_URL,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

local_repository(
Expand Down
24 changes: 3 additions & 21 deletions tests/miniforge/mamba/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_PYTHON_NAME = "rules_python"

RULES_PYTHON_TAG = "0.4.0"

RULES_PYTHON_SHA = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea"

RULES_PYTHON_REPO = "bazelbuild"

RULES_PYTHON_ARCHIVE = "tar.gz"

RULES_PYTHON_URL = "https://github.com/{repo}/{name}/releases/download/{tag}/{name}-{tag}.{archive}".format(
name = RULES_PYTHON_NAME,
archive = RULES_PYTHON_ARCHIVE,
repo = RULES_PYTHON_REPO,
tag = RULES_PYTHON_TAG,
)

http_archive(
name = RULES_PYTHON_NAME,
sha256 = RULES_PYTHON_SHA,
url = RULES_PYTHON_URL,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

local_repository(
Expand Down

0 comments on commit 269657d

Please sign in to comment.