8000 gh-294: Vendor lib2to3 by corona10 · Pull Request #302 · python/pyperformance · GitHub
[go: up one dir, main page]

Skip to content

gh-294: Vendor lib2to3 #302

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

Merged
merged 6 commits into from
Jun 12, 2023
Merged
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
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed Jun 11, 2023
commit af97e405363d9fcbeded962ea87c2556dd47800a
Copy link
Member

Choose a reason for hiding this comment

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

Since you mentioned wanting to avoid this hack and wanting to install it with pyproject.toml instead, I thought some more about this and left a comment below explaining how you should be able to avoid all the changes to this file and instead just add lib2to3 it as a dependency to the bm_2to3/pyproject.toml.

Copy link
Member

Choose a reason for hiding this comment

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

What he said.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since you mentioned wanting to avoid this hack and wanting to install it with pyproject.toml instead, I thought some more about this and left a comment below explaining how you should be able to avoid all the changes to this file and instead just add lib2to3 it as a dependency to the bm_2to3/pyproject.toml.

What he said.

As I commented on the discord, VCS approach is the most approximated way to handle this, but I will keep the current approach since managing the VCS URL has some issues when we want to modify the codes and the bootstrap(?) problem.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
import lib2to3
except ModuleNotFoundError:
vendor = os.path.join(os.path.dirname(__file__), 'vendor')
subprocess.run([sys.executable, "-m", "pip", "install", vendor])
subprocess.run([sys.executable, "-m", "pip", "install", vendor], check=True)

runner.bench_command('2to3', command)
14 changes: 14 additions & 0 deletions pyperformance/data-files/benchmarks/bm_2to3/vendor/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "lib2to3"
version = "3.12"
description = "lib2to3 for Python 3.13+"

[tool.setuptools.package-data]
"*" = ["*.txt"]

[tool.setuptools.packages.find]
where = ["src"]
10 changes: 0 additions & 10 deletions pyperformance/data-files/benchmarks/bm_2to3/vendor/setup.py

This file was deleted.

0