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

build: Remove deprecated package set #227

Merged
merged 1 commit into from
Jan 2, 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
625 changes: 599 additions & 26 deletions build/checks/build-systems.nix

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/checks/fixtures/myapp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"zipp"
"flit-core"
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion build/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
lib.fix (self: {
packages = import ./packages.nix {
inherit (self.lib) resolvers;
inherit pyproject-nix lib;
inherit lib;
};
lib = import ./lib { inherit lib pyproject-nix; };
hacks = import ./hacks;
Expand Down
233 changes: 0 additions & 233 deletions build/lib/test_renderers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,239 +51,6 @@ in

in
{
testPandas = {
expr = renderFixture "pandas.toml";
expected = {
meta = {
description = "Powerful data structures for data analysis, time series, and statistics";
};
nativeBuildInputs = [
null
"cython"
"meson"
"ninja"
"meson-python"
"meson"
"ninja"
"pyproject-metadata"
"packaging"
"tomli"
"oldest-supported-numpy"
"numpy"
"versioneer"
"tomli"
"wheel"
];
passthru = {
dependency-groups = { };
dependencies = {
numpy = [ ];
python-dateutil = [ ];
pytz = [ ];
tzdata = [ ];
};
optional-dependencies = {
all = {
beautifulsoup4 = [ ];
bottleneck = [ ];
brotlipy = [ ];
fastparquet = [ ];
fsspec = [ ];
gcsfs = [ ];
html5lib = [ ];
hypothesis = [ ];
jinja2 = [ ];
lxml = [ ];
matplotlib = [ ];
numba = [ ];
numexpr = [ ];
odfpy = [ ];
openpyxl = [ ];
pandas-gbq = [ ];
psycopg2 = [ ];
pyarrow = [ ];
pymysql = [ ];
pyqt5 = [ ];
pyreadstat = [ ];
pytest = [ ];
pytest-asyncio = [ ];
pytest-xdist = [ ];
python-snappy = [ ];
pyxlsb = [ ];
qtpy = [ ];
s3fs = [ ];
scipy = [ ];
sqlalchemy = [ ];
tables = [ ];
tabulate = [ ];
xarray = [ ];
xlrd = [ ];
xlsxwriter = [ ];
zstandard = [ ];
};
aws = {
s3fs = [ ];
};
clipboard = {
pyqt5 = [ ];
qtpy = [ ];
};
compression = {
brotlipy = [ ];
python-snappy = [ ];
zstandard = [ ];
};
computation = {
scipy = [ ];
xarray = [ ];
};
excel = {
odfpy = [ ];
openpyxl = [ ];
pyxlsb = [ ];
xlrd = [ ];
xlsxwriter = [ ];
};
feather = {
pyarrow = [ ];
};
fss = {
fsspec = [ ];
};
gcp = {
gcsfs = [ ];
pandas-gbq = [ ];
};
hdf5 = {
tables = [ ];
};
html = {
beautifulsoup4 = [ ];
html5lib = [ ];
lxml = [ ];
};
mysql = {
pymysql = [ ];
sqlalchemy = [ ];
};
output_formatting = {
jinja2 = [ ];
tabulate = [ ];
};
parquet = {
pyarrow = [ ];
};
performance = {
bottleneck = [ ];
numba = [ ];
numexpr = [ ];
};
plot = {
matplotlib = [ ];
};
postgresql = {
psycopg2 = [ ];
sqlalchemy = [ ];
};
spss = {
pyreadstat = [ ];
};
sql-other = {
sqlalchemy = [ ];
};
test = {
hypothesis = [ ];
pytest = [ ];
pytest-asyncio = [ ];
pytest-xdist = [ ];
};
xml = {
lxml = [ ];
};
};
};
pname = "pandas";
name = "pandas";
};
};

testPdm = {
expr = renderFixture "pdm.toml";
expected = {
meta = {
description = "A modern Python package and dependency manager supporting the latest PEP standards";
license = {
deprecated = false;
free = true;
fullName = "MIT License";
redistributable = true;
shortName = "mit";
spdxId = "MIT";
url = "https://spdx.org/licenses/MIT.html";
};
mainProgram = "pdm";
};
nativeBuildInputs = [
null
"pdm-backend"
];
passthru = {
dependency-groups = { };
dependencies = {
blinker = [ ];
cachecontrol = [ "filecache" ];
certifi = [ ];
findpython = [ ];
installer = [ ];
packaging = [ ];
platformdirs = [ ];
pyproject-hooks = [ ];
python-dotenv = [ ];
requests-toolbelt = [ ];
resolvelib = [ ];
rich = [ ];
shellingham = [ ];
tomlkit = [ ];
unearth = [ ];
virtualenv = [ ];
};
optional-dependencies = {
all = {
pdm = [
"keyring"
"template"
"truststore"
];
};
cookiecutter = {
cookiecutter = [ ];
};
copier = {
copier = [ ];
};
keyring = {
keyring = [ ];
};
pytest = {
pytest = [ ];
pytest-mock = [ ];
};
template = {
pdm = [
"copier"
"cookiecutter"
];
};
truststore = {
truststore = [ ];
};
};
};
pname = "pdm";
name = "pdm";
};
};

testUv = {
expr = renderFixture "uv.toml";
expected = {
Expand Down
29 changes: 2 additions & 27 deletions build/packages.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
{
lib,
resolvers,
pyproject-nix,
}:
let
inherit (resolvers) resolveCyclic resolveNonCyclic;
inherit (lib) makeScope concatStringsSep escapeShellArg;

mkPkgs' = import ./pkgs { inherit pyproject-nix lib; };

# Build-system package names to memoise
memoNames = lib.attrNames (mkPkgs' {
# Hack: We only need attrNames
callPackage = null;
});

mkResolveBuildSystem =
set:
let
resolveNonCyclic' = resolveNonCyclic memoNames set;
resolveNonCyclic' = resolveNonCyclic [ ] set;

# Implement fallback behaviour in case of empty build-system
fallbackSystems = map (name: set.${name}) (resolveNonCyclic' {
Expand All @@ -30,24 +21,11 @@ let

mkResolveVirtualEnv = set: spec: map (name: set.${name}) (resolveCyclic set spec);

deprecatedBuild = name: ''
You are using '${name}' from the pyproject.nix base package set, which is deprecated and will be removed shortly.

Build-system packages have been moved into their own repository which can be found at
https://github.com/pyproject-nix/build-system-pkgs
'';
pkgsFun =
final:
lib.mapAttrs (name: drv: builtins.trace (deprecatedBuild name) drv) (mkPkgs' {
inherit (final) callPackage;
});

mkPythonSet =
{
python,
stdenv,
pythonPkgsBuildHost,
pythonPkgsFun,
pkgsFinal,
}:
{
Expand Down Expand Up @@ -100,8 +78,7 @@ let
pyprojectHook
pyprojectWheelHook
;
}
// pythonPkgsFun pkgsFinal;
};

in

Expand Down Expand Up @@ -162,7 +139,6 @@ makeScope newScope (
inherit python stdenv;
pkgsFinal = final;
pythonPkgsBuildHost = final.pythonPkgsHostHost;
pythonPkgsFun = pkgsFun;
})
// {
# Python packages for the build host.
Expand All @@ -176,7 +152,6 @@ makeScope newScope (
inherit (buildPackages) stdenv;
python = python.pythonOnBuildForHost;
inherit (final) pythonPkgsBuildHost;
pythonPkgsFun = pkgsFun;
inherit pkgsFinal;
}
))
Expand Down
22 changes: 0 additions & 22 deletions build/pkgs/babel/default.nix

This file was deleted.

34 changes: 0 additions & 34 deletions build/pkgs/build/default.nix

This file was deleted.

Loading
Loading