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

replace pipreqs with pip freeze #1384

Merged
merged 6 commits into from
Jun 30, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `dict`s and `Namespace`s that are written to runs and contain an empty string "" key now produce a warning and drop
the entry with such a key instead of raising an
exception ([#1374](https://github.com/neptune-ai/neptune-client/pull/1374))
- Fix dependency tracking by replacing `pipreqs` with `pip freeze` ([#1384](https://github.com/neptune-ai/neptune-client/pull/1384))

### Changes
- Added support of writing to archived project exception ([#1355](https://github.com/neptune-ai/neptune-client/pull/1355))
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ future = ">=0.17.1"
# Utility
packaging = "*"
click = ">=7.0"
pipreqs = ">=0.4"

# Networking
bravado = "^11.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/neptune/internal/utils/dependency_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import os
import subprocess
import sys
from abc import (
ABC,
abstractmethod,
Expand All @@ -30,7 +31,7 @@ def log_dependencies(self, run: "Run") -> None:
class InferDependenciesStrategy(DependencyTrackingStrategy):
def log_dependencies(self, run: "Run") -> None:
try:
dependencies_str = subprocess.check_output(["pipreqs", "--print", "."]).decode("utf-8")
dependencies_str = subprocess.check_output([sys.executable, "-m", "pip", "freeze"]).decode("utf-8")
except subprocess.SubprocessError:
return

Expand Down
2 changes: 1 addition & 1 deletion src/neptune/metadata_containers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def __init__(
To turn off Git tracking for the run, set to GitRef.DISABLED.
dependencies: To track the project dependencies, pass a path to your dependency file.
If None, no dependency file is uploaded.
If you pass `"infer"`, Neptune uses [pipreqs](https://pypi.org/project/pipreqs) to upload
If you pass `"infer"`, Neptune will run `pip freeze` to generate and upload
the requirements.

Returns:
Expand Down
Loading