Skip to content

Commit

Permalink
Sync with #7536
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Jul 8, 2024
1 parent 6404a94 commit 156914f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import shutil
import subprocess
import textwrap
import tomllib

import setuptools
from setuptools import extension as setuptools_extension
Expand Down Expand Up @@ -562,16 +563,16 @@ def run(self):
print(binascii.hexlify(bootstrap_hash).decode())

elif self.type == 'rust':
rust_hash = hash_dirs([
(pkg_dir / 'edgeql-parser', '.rs'),
(pkg_dir / 'graphql-rewrite', '.rs'),
(pkg_dir / 'server/conn_pool', '.rs'),
], extra_files=[
pkg_dir / 'edgeql-parser/Cargo.toml',
pkg_dir / 'edgeql-parser/edgeql-parser-python/Cargo.toml',
pkg_dir / 'graphql-rewrite/Cargo.toml',
pkg_dir / 'server/conn_pool/Cargo.toml',
])
dirs = []
# Read the list of Rust projects from Cargo.toml
with open(pkg_dir.parent / 'Cargo.toml', 'rb') as f:
root = tomllib.load(f)
for member in root['workspace']['members']:
dirs.append(pkg_dir.parent / member)
rust_hash = hash_dirs(
[(dir, '.rs') for dir in dirs],
extra_files=[dir / 'Cargo.toml' for dir in dirs] +
[pkg_dir.parent / 'Cargo.lock'])
print(binascii.hexlify(rust_hash).decode())

elif self.type == 'ext':
Expand Down

0 comments on commit 156914f

Please sign in to comment.