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

rpds-py 0.22.3 (new formula) #201147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,7 @@ rospo
roswell
rover
roxctl
rpds-py
rpg-cli
rpki-client
rpl
Expand Down
73 changes: 73 additions & 0 deletions Formula/r/rpds-py.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
class RpdsPy < Formula
include Language::Python::Virtualenv

desc "Python bindings to Rust's persistent data structures"
homepage "https://rpds.readthedocs.io/en/latest/"
url "https://files.pythonhosted.org/packages/01/80/cce854d0921ff2f0a9fa831ba3ad3c65cee3a46711addf39a2af52df2cfd/rpds_py-0.22.3.tar.gz"
sha256 "e32fee8ab45d3c2db6da19a5323bc3362237c8b653c70194414b892fd06a080d"
license "MIT"

depends_on "maturin" => :build
depends_on "[email protected]" => [:build, :test]
depends_on "[email protected]" => [:build, :test]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that this was the expected combination of python versions, from other formulae.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SMillerDev added the most recent python version

depends_on "rust" => :build

resource "semantic-version" do
url "https://files.pythonhosted.org/packages/7d/31/f2289ce78b9b473d582568c234e104d2a342fd658cc288a7553d83bb8595/semantic_version-2.10.0.tar.gz"
sha256 "bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c"
end

resource "setuptools" do
url "https://files.pythonhosted.org/packages/43/54/292f26c208734e9a7f067aea4a7e282c080750c4546559b58e2e45413ca0/setuptools-75.6.0.tar.gz"
sha256 "8199222558df7c86216af4f84c30e9b34a61d8ba19366cc914424cdbd28252f6"
end

resource "setuptools-rust" do
url "https://files.pythonhosted.org/packages/d3/6b/99a1588d826ceb108694ba00f78bc6afda10ed5d72d550ae8f256af1f7b4/setuptools_rust-1.10.2.tar.gz"
sha256 "5d73e7eee5f87a6417285b617c97088a7c20d1a70fcea60e3bdc94ff567c29dc"
end

def pythons
deps.map(&:to_formula)
.select { |f| f.name.start_with?("python@") }
.map { |f| f.opt_libexec/"bin/python" }
end

def install
ENV.append_path "PATH", buildpath/"bin"
pythons.each do |python3|
ENV.append_path "PYTHONPATH", buildpath/Language::Python.site_packages(python3)

deps = %w[setuptools setuptools-rust semantic-version]
deps.each do |r|
resource(r).stage do
system python3, "-m", "pip", "install", *std_pip_args(prefix: buildpath), "."
end
end

system python3, "-m", "pip", "install", *std_pip_args, "."
end
end

test do
(testpath/"test.py").write <<~EOS
from rpds import HashTrieMap, HashTrieSet, List
m = HashTrieMap({"foo": "bar", "baz": "quux"})
assert m.insert("spam", 37) == HashTrieMap({"foo": "bar", "baz": "quux", "spam": 37})
assert m.remove("foo") == HashTrieMap({"baz": "quux"})
s = HashTrieSet({"foo", "bar", "baz", "quux"})
assert s.insert("spam") == HashTrieSet({"foo", "bar", "baz", "quux", "spam"})
assert s.remove("foo") == HashTrieSet({"bar", "baz", "quux"})
L = List([1, 3, 5])
assert L.push_front(-1) == List([-1, 1, 3, 5])
assert L.rest == List([3, 5])
EOS

pythons.each do |python3|
system python3, "test.py"
end
end
end
3 changes: 3 additions & 0 deletions pypi_formula_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,9 @@
"extra_packages": ["robotframework-archivelibrary", "robotframework-selenium2library", "robotframework-sshlibrary"],
"exclude_packages": ["certifi", "cryptography"]
},
"rpds-py": {
"extra_packages": ["setuptools-rust"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because that's what was in #178716, and because it is needed by the build process of rpds-py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I think this is the kind of indirect dependency @cho-m explained to me here)

},
"ruff-lsp": {
"exclude_packages": ["ruff"]
},
Expand Down
Loading