Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f670351
Update PyOpenSSL to the second-latest version
hacklschorsch Nov 5, 2024
aae9a87
Update pycddl 0.4.0 to 0.6.3
hacklschorsch Nov 5, 2024
99f3d4f
Update flake8-isort 6.0.0 -> 6.1.0, add missing pip to flake8-black
hacklschorsch Nov 5, 2024
cd2f361
Upgrade Python compose 1.4.8 -> 1.6.2
hacklschorsch Nov 5, 2024
ec45d04
Upgrade mypy-zope 0.3.11 -> 1.0.9
hacklschorsch Nov 5, 2024
cf1f181
Upgrade types-PyYAML 6.0.12.9 -> 6.0.12.20240917
hacklschorsch Nov 5, 2024
effca2d
Add Python 3.11 and 3.12 to exposed packages
hacklschorsch Nov 5, 2024
0405dc8
Add newer Python versions to CI
hacklschorsch Nov 5, 2024
77e2878
Vendor collections-extended and link to a version that works with Pyt…
hacklschorsch Nov 5, 2024
b8321a1
Vendor magic-wormhole-transit-relay: Only the current master tip is P…
hacklschorsch Nov 5, 2024
cdca045
Vendor magic-wormhole-mailbox-server: Only the current master tip is …
hacklschorsch Nov 5, 2024
ff696a5
huh
hacklschorsch Nov 5, 2024
2aaa83d
vendor eliot because of their broken versioneer
hacklschorsch Nov 5, 2024
07b6588
Upgrade to eliot 1.15 for Python 3.12
hacklschorsch Nov 5, 2024
dd09c8a
Fetch new magic-wormhole-transit-relay nix expression
hacklschorsch Nov 6, 2024
363398c
magic-wormhole breaks with latest -transit-relay, so update it, but t…
hacklschorsch Nov 6, 2024
6c202a6
We use nixpkg's hypothesis now
hacklschorsch Nov 6, 2024
ecc470d
recent tahoe-lafs requires pip and orjson to install
hacklschorsch Nov 6, 2024
d19e68b
Vendor eliot-tree to get latest version with Python 3.12 fixes
hacklschorsch Nov 6, 2024
0f94894
Merge branch 'main' into update-2024-11
hacklschorsch Nov 7, 2024
230a21f
Update nix docker image for circleCI
hacklschorsch Nov 7, 2024
21aec55
Remove ipython - it's getting in the way of our Python39 build
hacklschorsch Nov 8, 2024
5baad6d
Don't run Twisted runtimeDeps check: It fails to find zope-interface …
hacklschorsch Nov 8, 2024
df68d0d
CI gets a different fixed-output hash for magic-wormhole-transit-relay?
hacklschorsch Nov 8, 2024
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
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ aliases:

- nix_docker: &NIX_DOCKER
# Run in a highly Nix-capable environment.
- image: "nixos/nix:2.15.0"
- image: "nixos/nix:2.18.9"

- nix_environ: &NIX_ENVIRON
# Let us use features marked "experimental". For example, most/all of
Expand Down Expand Up @@ -515,6 +515,8 @@ workflows:
py-version:
- "39"
- "310"
- "311"
- "312"
tahoe-lafs:
- "1_18_0"
# This is usually not master@HEAD because it is still pinned to
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# The names of the nixpkgs Python derivations for which we will expose
# packages.
pyVersions = [ "python310" "python39" ];
pyVersions = [ "python312" "python311" "python310" "python39" ];

# All of the versions our Tahoe-LAFS dependency for which we will expose
# packages.
Expand Down
44 changes: 44 additions & 0 deletions nix/collections-extended.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hypothesis,
poetry-core,
pytestCheckHook,
pythonOlder,
pythonAtLeast,
}:

buildPythonPackage rec {
pname = "collections-extended";
version = "2.0.2.post1";
format = "pyproject";

# https://github.com/mlenzen/collections-extended/issues/198
# My own running the test suggest Python 3.12 is still fine.
disabled = pythonOlder "3.6" || pythonAtLeast "3.13";

src = fetchFromGitHub {
owner = "mlenzen";
repo = pname;
# This version includes our hero JP's patches for Python 3.11.
rev = "8b93390636d58d28012b8e9d22334ee64ca37d73";
hash = "sha256-e7RCpNsqyS1d3q0E+uaE4UOEQziueYsRkKEvy3gCHt0=";
};

nativeBuildInputs = [ poetry-core ];

nativeCheckInputs = [
hypothesis
pytestCheckHook
];

pythonImportsCheck = [ "collections_extended" ];

meta = with lib; {
description = "Extra Python Collections - bags (multisets), setlists (unique list/indexed set), RangeMap and IndexedDict";
homepage = "https://github.com/mlenzen/collections-extended";
license = licenses.asl20;
maintainers = with maintainers; [ exarkun ];
};
}
4 changes: 2 additions & 2 deletions nix/compose.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildPythonPackage rec {
pname = "compose";
version = "1.4.8";
version = "1.6.2";

src = fetchPypi {
inherit pname version;
sha256 = "sha256-mpRabfC4LE6xYlHmQbHb1yXxLDtH5idwN4GbUnCPGTo=";
sha256 = "sha256-yUP6goTByziSklOIhi4gPJiISE5M4/1RcVBnaWkNi00=";
};

meta = with lib; {
Expand Down
54 changes: 54 additions & 0 deletions nix/eliot-tree.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
lib,
python3Packages,
fetchPypi,
}:

python3Packages.buildPythonApplication rec {
pname = "eliot-tree";
version = "21.0.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-hTl+r+QJPPQ7ss73lty3Wm7DLy2SKGmmgIuJx38ilO8=";
};

# Patch Python 3.12 incompatibilities in versioneer.py.
postPatch = ''
substituteInPlace versioneer.py \
--replace-fail SafeConfigParser ConfigParser \
--replace-fail readfp read_file
'';

build-system = with python3Packages; [ setuptools ];

dependencies = with python3Packages; [
colored
eliot
iso8601
jmespath
toolz
];

nativeCheckInputs = with python3Packages; [
pytestCheckHook
testtools
];

# Tests run eliot-tree in out/bin.
preCheck = ''
export PATH=$out/bin:$PATH
'';

pythonImportsCheck = [ "eliottree" ];

meta = {
homepage = "https://github.com/jonathanj/eliottree";
changelog = "https://github.com/jonathanj/eliottree/blob/${version}/NEWS.rst";
description = "Render Eliot logs as an ASCII tree";
mainProgram = "eliot-tree";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.dpausp ];
};
}
66 changes: 66 additions & 0 deletions nix/eliot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
aiocontextvars,
boltons,
hypothesis,
pyrsistent,
pytestCheckHook,
setuptools,
six,
testtools,
zope-interface,
}:

buildPythonPackage rec {
pname = "eliot";
version = "1.15.0";
format = "setuptools";

disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = "itamarst";
repo = "eliot";
rev = "1.15.0";
hash = "sha256-Ur7q7PZ5HH4ttD3b0HyBTe1B7eQ2nEWcTBR/Hjeg9yw=";
};

propagatedBuildInputs = [
aiocontextvars
boltons
pyrsistent
setuptools
six
zope-interface
];

nativeCheckInputs = [
hypothesis
pytestCheckHook
testtools
];

pythonImportsCheck = [ "eliot" ];

# Tests run eliot-prettyprint in out/bin.
preCheck = ''
export PATH=$out/bin:$PATH
'';

disabledTests = [
"test_parse_stream"
# AttributeError: module 'inspect' has no attribute 'getargspec'
"test_default"
];

meta = with lib; {
homepage = "https://eliot.readthedocs.io";
description = "Logging library that tells you why it happened";
mainProgram = "eliot-prettyprint";
license = licenses.asl20;
maintainers = with maintainers; [ dpausp ];
};
}
3 changes: 2 additions & 1 deletion nix/flake8-black.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, black
, tomli
, setuptools
, pip
}:
buildPythonPackage rec {
pname = "flake8-black";
Expand All @@ -16,7 +17,7 @@ buildPythonPackage rec {

format = "pyproject";
# doCheck = false;
buildInputs = [ setuptools ];
buildInputs = [ setuptools pip ];
propagatedBuildInputs = [ flake8 black tomli ];
pythonImportsCheck = [ "flake8_black" ];
}
4 changes: 2 additions & 2 deletions nix/flake8-isort.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
}:
buildPythonPackage rec {
pname = "flake8-isort";
version = "6.0.0";
version = "6.1.0";

src = fetchPypi {
inherit pname version;
hash = "sha256-U39FOmYNfpA/YC7Po2E2sUDeJ531jQLrG2oMhOg8Uow=";
hash = "sha256-1GOTQ7rFQBlMWfsWGKwsKFs+J2CfNTvvb1CQTUDBZD4=";
};

doCheck = false;
Expand Down
11 changes: 0 additions & 11 deletions nix/hypothesis.nix

This file was deleted.

29 changes: 23 additions & 6 deletions nix/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ rec {
# tokenize-rt = null;
});

# Something wants ipython - it breaks Python39 though, so we turn it off.
ipython = null;

tqdm = dontCheck super.tqdm;

isort = dontCheck super.isort;
Expand All @@ -84,11 +87,25 @@ rec {
mypy-zope = self.callPackage ./mypy-zope.nix {};
types-PyYAML = self.callPackage ./types-pyyaml.nix {};

# Hypothesis 6.54-ish has a bug that causes our test suite to fail.
# Get a newer one.
hypothesis = self.callPackage ./hypothesis.nix {
inherit (super) hypothesis;
};
# Only the current master tip is Python 3.12 ready.
magic-wormhole-transit-relay = self.callPackage ./magic-wormhole-transit-relay.nix {};
magic-wormhole-mailbox-server = self.callPackage ./magic-wormhole-mailbox-server.nix {};
# Magic Wormhole tests break with the updated version of transit-relay from above.
magic-wormhole = self.callPackage ./magic-wormhole.nix {};
# Latest magic-wormhole requires latest spake2
spake2 = self.callPackage ./spake2.nix {};

# collections-extended isn't maintained anymore.
collections-extended = self.callPackage ./collections-extended.nix {};

# eliot 1.15 upgrades its bundled versioneer and works with Python 3.12
eliot = self.callPackage ./eliot.nix {};
eliot-tree = self.callPackage ./eliot-tree.nix {};

# Twisted runtimeDeps check fails to find zope-interface on Python 3.9
twisted = super.twisted.overrideAttrs (old: {
dontCheckRuntimeDeps = true;
});
};
}); in with python.pkgs;
buildPythonPackage rec {
Expand All @@ -109,7 +126,7 @@ rec {
testresources
hypothesis
openapi-spec-validator
(toPythonModule (pkgs.eliot-tree.override { python3Packages = python.pkgs; }))
(toPythonModule (eliot-tree.override { python3Packages = python.pkgs; }))
];

postFixup = ''
Expand Down
63 changes: 63 additions & 0 deletions nix/magic-wormhole-mailbox-server.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
setuptools,
six,
attrs,
twisted,
autobahn,
treq,
mock,
pythonOlder,
pythonAtLeast,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "magic-wormhole-mailbox-server";
version = "0.4.1.post1";
pyproject = true;

# python 3.12 support: https://github.com/magic-wormhole/magic-wormhole-mailbox-server/issues/41
disabled = pythonOlder "3.7" || pythonAtLeast "3.13";

src = fetchFromGitHub {
owner = "magic-wormhole";
repo = "magic-wormhole-mailbox-server";
rev = "30ecb6e3f6f487c915e7ff0acdf2e630cbe17dc8";
hash = "sha256-I07bQmWrGppxBvQyCndPlkc94KjBfcswVa8aTjHE66o=";
};

nativeBuildInputs = [ setuptools ];

propagatedBuildInputs = [
attrs
six
twisted
autobahn
] ++ autobahn.optional-dependencies.twisted ++ twisted.optional-dependencies.tls;

pythonImportsCheck = [ "wormhole_mailbox_server" ];

nativeCheckInputs = [
pytestCheckHook
treq
mock
];

disabledTestPaths = lib.optionals stdenv.isDarwin [
# these tests fail in Darwin's sandbox
"src/wormhole_mailbox_server/test/test_web.py"
];

meta = {
description = "Securely transfer data between computers";
homepage = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server";
changelog = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/blob/${version}/NEWS.md";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.mjoerg ];
};
}
Loading