Skip to content

Commit

Permalink
remove more unwanted dependencies, kill tests
Browse files Browse the repository at this point in the history
  • Loading branch information
minestarks committed Jan 15, 2025
1 parent 0da1f42 commit b51f078
Show file tree
Hide file tree
Showing 5 changed files with 1,473 additions and 7,477 deletions.
46 changes: 31 additions & 15 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
)

parser.add_argument(
"--ci-bench",
action=argparse.BooleanOptionalAction,
default=False,
help="Run the benchmarking script that is run in CI (default is --no-ci-bench)",
"--ci-bench",
action=argparse.BooleanOptionalAction,
default=False,
help="Run the benchmarking script that is run in CI (default is --no-ci-bench)",
)

args = parser.parse_args()
Expand Down Expand Up @@ -304,25 +304,46 @@ def run_python_integration_tests(cwd, interpreter):
def run_ci_historic_benchmark():
branch = "main"
output = subprocess.check_output(
["git", "rev-list", "--since=1 week ago", "--pretty=format:%ad__%h", "--date=short", branch]
[
"git",
"rev-list",
"--since=1 week ago",
"--pretty=format:%ad__%h",
"--date=short",
branch,
]
).decode("utf-8")
print('\n'.join([line for i, line in enumerate(output.split('\n')) if i % 2 == 1]))
print("\n".join([line for i, line in enumerate(output.split("\n")) if i % 2 == 1]))

output = subprocess.check_output(
["git", "rev-list", "--since=1 week ago", "--pretty=format:%ad__%h", "--date=short", branch]
[
"git",
"rev-list",
"--since=1 week ago",
"--pretty=format:%ad__%h",
"--date=short",
branch,
]
).decode("utf-8")
date_and_commits = [line for i, line in enumerate(output.split('\n')) if i % 2 == 1]
date_and_commits = [line for i, line in enumerate(output.split("\n")) if i % 2 == 1]

for date_and_commit in date_and_commits:
print("benching commit", date_and_commit)
result = subprocess.run(
["cargo", "criterion", "--message-format=json", "--history-id", date_and_commit],
[
"cargo",
"criterion",
"--message-format=json",
"--history-id",
date_and_commit,
],
capture_output=True,
text=True
text=True,
)
with open(f"{date_and_commit}.json", "w") as f:
f.write(result.stdout)


if build_pip:
step_start("Building the pip package")

Expand Down Expand Up @@ -388,11 +409,6 @@ def run_ci_historic_benchmark():
subprocess.run(npm_args, check=True, text=True, cwd=circuit_vis_src)
step_end()

if run_tests:
step_start("Running the circuit_vis tests")
subprocess.run([npm_cmd, "test"], check=True, text=True, cwd=circuit_vis_src)
step_end()

if build_npm:
step_start("Building the npm package")
# Copy the wasm build files over for web and node targets
Expand Down
16 changes: 1 addition & 15 deletions circuit_vis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
"scripts": {
"build": "tsc",
"build:prod": "tsc && webpack",
"coverage": "jest --coverage",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"prepublishOnly": "npm run lint && npm run test && npm run build:prod",
"start": "tsc -w",
"test": "jest"
"start": "tsc -w"
},
"files": [
"README.md",
Expand All @@ -30,17 +28,5 @@
],
"author": "Microsoft Quantum",
"license": "MIT",
"devDependencies": {
"@types/jest": "^26.0.4",
"@types/prettier": "2.6.0",
"jest": "^26.6.3",
"prettier": "2.6.0",
"terser-webpack-plugin": "^4.1.0",
"ts-jest": "^26.1.2",
"ts-loader": "^8.0.2",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
},
"homepage": "https://github.com/microsoft/quantum-viz.js#readme"
}
2 changes: 1 addition & 1 deletion circuit_vis/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const config = {
minimize: true,
minimizer: [
new TerserPlugin({
sourceMap: true,
// sourceMap: true,
include: /\.min\.js$/,
}),
],
Expand Down
Loading

0 comments on commit b51f078

Please sign in to comment.