Skip to content

Support calling compile command from when cwd is a source checkout #207

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

Closed
wants to merge 1 commit into from

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented May 23, 2022

The pyperformance compile command currently fails when the current directory
is a source checkout, since the installation of pyperformance in the benchmark
venv is slightly broken, and the detection of running from a source checkout is
slightly broken. This is true whether using python -m pyperformance or python ./dev.py methods.

  • To detect whether performance is being imported from an "installation" rather
    than the source directory, it imports toml and then sees if there is a
    pyperformance package sitting alongside it. This (perhaps) worked in the past
    when toml was a module, but it's currently a package, so we need to go up two
    levels of directories.

  • pyperformance is installed in the benchmark venvs with pip install ., but
    pip install -e . actually installs in editable/developer mode, as described
    elsewhere.

I struggled to write a short-running unit test for this -- there are a lot of moving parts that need to align to reproduce this. However, there is an existing test that currently fails on main, but passes with these changes. It's marked as @SLOW, so I suspect it hasn't run on CI in quite some time. I'd appreciate any thoughts about whether that's sufficient...

The `pyperformance compile` command currently fails when the current directory
is a source checkout, since the installation of pyperformance in the benchmark
venv is slightly broken, and the detection of running from a source checkout is
slightly broken. This is true whether using `python -m pyperformance` or `python
./dev.py` methods.

- To detect whether performance is being imported from an "installation" rather
than the source directory, it imports toml and then sees if there is a
`pyperformance` package sitting alongside it. This (perhaps) worked in the past
when `toml` was a module, but it's currently a package, so we need to go up two
levels of directories.

- `pyperformance` is installed in the benchmark venvs with `pip install .`, but
`pip install -e .` actually installs in editable/developer mode, as described
elsewhere.
@kumaraditya303 kumaraditya303 self-requested a review June 13, 2022 13:10
@mdboom
Copy link
Contributor Author

mdboom commented Jul 5, 2022

@kumaraditya303: Would you mind giving this a review?

@kumaraditya303
Copy link
Contributor

Would you mind giving this a review?

Sure, I was waiting for someone to allow CI as I don't have the permission. I'll test it locally now.

@kumaraditya303
Copy link
Contributor

@mdboom: Do you an example of config file with which you tested it ?

@mdboom
Copy link
Contributor Author

mdboom commented Jul 26, 2022

Closing this -- it's kind of a corner case in practice and I haven't hit it again since.

@mdboom mdboom closed this Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants