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

Support for Conda environments #20

Merged
merged 3 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ Instruction-level parallelism, branch mispredictions, SIMD, and the CPU memory c

## Changelog

### v0.3.2

* `python -m profila setup` should now work correctly in Conda environments.
* Support for latest IPython.
* Support for Python 3.13.

### v0.3.1

Documentation improvements.
Expand Down
2 changes: 1 addition & 1 deletion src/profila/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def load_ipython_extension(ipython: object) -> None:
"""Load our IPython magic"""
from IPython.core.error import UsageError
from IPython.core.display import display, Markdown
from IPython.display import display, Markdown

if "numba" in sys.modules:
raise UsageError(
Expand Down
4 changes: 4 additions & 0 deletions src/profila/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def setup_command(args: Namespace) -> None:
tarfile.open(fileobj=f).extract("bin/micromamba", STORAGE_PATH)
os.chmod(MICROMAMBA_PATH, 0o775)
env = os.environ.copy()
# Ensure existing Conda environment doesn't break things:
for key in list(env.keys()):
if key.startswith("CONDA_") or key.startswith("MAMBA_"):
env.pop(key)
env["MAMBA_ROOT_PREFIX"] = STORAGE_PATH
subprocess.check_call(
[
Expand Down
3 changes: 2 additions & 1 deletion src/profila/_ipython.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
IPython/Jupyter magics.
"""

import ctypes
import json
import sys
Expand All @@ -12,7 +13,7 @@
from ._render import render_text

from IPython.core.magic import Magics, magics_class, cell_magic
from IPython.core.display import display, Markdown
from IPython.display import display, Markdown

libc = ctypes.CDLL("libc.so.6")
prctl = libc.prctl
Expand Down
Loading