Skip to content

Commit

Permalink
sample_projects: Add Pixi project w/default settings
Browse files Browse the repository at this point in the history
This was created with the following commands:

  - pixi init pixi_default_example
  - cd pixi_default_example/
  - pixi add python
  - pixi add --pypi requests
  - pixi add ninja
  - echo "import requests" > main.py

followed by removing/truncating files that I do not currently consider
to be important for FawltyDeps to make sense of this project.

The result is a simple Pixi project with two declared Conda
dependencies (Python itself + ninja) and one PyPI dependency
(requests), along with a single source file that imports requests.

The expected result of running FawltyDeps here is reporting ninja as an
unused dependency. This is because ninja is a Conda package with no
Python components, and since it is not found as a Python package, we
fall back to the identity mapping and expect it to be imported as
"ninja".

We should fix this by digging into the Conda environment to discover
that ninja has no Python components, and therefore is not expected to be
imported.
  • Loading branch information
jherland committed Sep 11, 2024
1 parent 11715c8 commit 7521268
Show file tree
Hide file tree
Showing 43 changed files with 15,700 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/sample_projects/pixi_default_example/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
3 changes: 3 additions & 0 deletions tests/sample_projects/pixi_default_example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pixi environments
.pixi
*.egg-info
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// not relevant for pixi but for `conda run -p`
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"build": "h297d8ca_0",
"build_number": 0,
"depends": [
"libgcc-ng >=12",
"libstdcxx-ng >=12"
],
"license": "Apache-2.0",
"license_family": "Apache",
"md5": "3aa1c7e292afeff25a0091ddd7c69b72",
"name": "ninja",
"purls": [],
"sha256": "40f7b76b07067935f8a5886aab0164067b7aa71eb5ad20b7278618c0c2c98e06",
"size": 2198858,
"subdir": "linux-64",
"timestamp": 1715440571685,
"version": "1.12.1",
"fn": "ninja-1.12.1-h297d8ca_0.conda",
"url": "https://conda.anaconda.org/conda-forge/linux-64/ninja-1.12.1-h297d8ca_0.conda",
"channel": "https://conda.anaconda.org/conda-forge/",
"extracted_package_dir": "/home/jherland/.cache/rattler/cache/pkgs/ninja-1.12.1-h297d8ca_0",
"files": [
"bin/ninja"
],
"paths_data": {
"paths_version": 1,
"paths": [
{
"_path": "bin/ninja",
"path_type": "hardlink",
"sha256": "b3aee46f212fcc09c222d02e600a060ba7cd5332d10b6fbaaac5f8ad56bdc9ee",
"sha256_in_prefix": "b3aee46f212fcc09c222d02e600a060ba7cd5332d10b6fbaaac5f8ad56bdc9ee",
"size_in_bytes": 7626496
}
]
},
"link": {
"source": "/home/jherland/.cache/rattler/cache/pkgs/ninja-1.12.1-h297d8ca_0",
"type": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"manifest_path": "/home/jherland/code/fawltydeps/tests/sample_projects/pixi_default_example/pixi.toml",
"environment_name": "default",
"pixi_version": "0.27.1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/jherland/code/fawltydeps/tests/sample_projects/pixi_default_example/.pixi/envs/default/conda-meta
Loading

0 comments on commit 7521268

Please sign in to comment.