Skip to content

Commit

Permalink
Problem: nixpkgs and python dependencies are out of date
Browse files Browse the repository at this point in the history
Solution:
- update nixpkgs to nixpkgs-unstable
- rustc to 1.75
- update python dependencies in integration tests
  • Loading branch information
yihuang committed Feb 21, 2024
1 parent c0436a5 commit 4029ffc
Show file tree
Hide file tree
Showing 9 changed files with 646 additions and 561 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ in
buildGoApplication rec {
pname = "chain-maind";
version = "4.2.8";
go = buildPackages.go_1_20;
go = buildPackages.go_1_22;
src = lib.cleanSourceWith {
name = "src";
src = lib.sourceByRegex ./. src_regexes;
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-bundle-exe = {
url = "github:3noch/nix-bundle-exe";
Expand Down
1,103 changes: 601 additions & 502 deletions integration_tests/poetry.lock

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions integration_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,21 @@ description = ""
authors = ["Your Name <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
pytest = "^7.1.3"
pytest-xdist = "^2.5.0"
flake8 = "^4.0.1"
black = "^22.6"
flake8-black = "^0.3.3"
flake8-isort = "^4.1.1"
grpcio = "^1.53.2"
grpcio-tools = "^1.42.0"
pep8-naming = "^0.11.1"
pytest-github-actions-annotate-failures = "^0.1.7"
protobuf = "^3.20.2"
pyyaml = "^6.0.1"
python-dateutil = "^2.8.1"
pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main", rev = "d86272f" }
python = "^3.9"
pytest = "^8.0"
pytest-xdist = "^3.5"
flake8 = "^7.0"
black = "^24.2"
flake8-black = "^0.3"
flake8-isort = "^6.1"
pep8-naming = "^0.13"
pytest-github-actions-annotate-failures = "^0.2"
protobuf = "^4.25"
pyyaml = "^6.0"
python-dateutil = "^2.8"
pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main" }
chainlibpy = "^2.2.0"

# manually upgrade to make hatchling build success in poetry2nix
pathspec = "^0.10.1"

[tool.poetry.dev-dependencies]

[build-system]
Expand Down
1 change: 1 addition & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import sources.nixpkgs {
};
hermes = pkgs.callPackage ./hermes.nix { src = sources.ibc-rs; };
})
(import "${sources.poetry2nix}/overlay.nix")
(import "${sources.gomod2nix}/overlay.nix")
(import ./build_overlay.nix)
(pkgs: prev: {
Expand Down
4 changes: 2 additions & 2 deletions nix/hermes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
, lib
, stdenv
, darwin
, rustPackages_1_70
, rustPlatform
, symlinkJoin
, openssl
}:
rustPackages_1_70.rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage rec {
name = "hermes";
inherit src;
cargoSha256 = "sha256-jqmIBmvY3PXpLFfv6XrnXJ0RmR6amFFMNfgK8qDFHb8=";
Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-23.05",
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9a333eaa80901efe01df07eade2c16d183761fa3",
"sha256": "0xhqjli4m9wkzv7xhs6fr1iajdjbv7xnj0bwvwldq9s6arlwkhj3",
"rev": "f33dd27a47ebdf11dc8a5eb05e7c8fbdaf89e73f",
"sha256": "1z8d4hclm483i9i9svd2bbbqww55x47il6ic1k6skfmyp5mb6h0h",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/9a333eaa80901efe01df07eade2c16d183761fa3.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/f33dd27a47ebdf11dc8a5eb05e7c8fbdaf89e73f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"poetry2nix": {
Expand Down
48 changes: 19 additions & 29 deletions nix/testenv.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
{ poetry2nix, python310, lib }:
{ poetry2nix, python311, lib }:
poetry2nix.mkPoetryEnv {
python = python310;
python = python311;
projectDir = ../integration_tests;
overrides = poetry2nix.overrides.withDefaults (lib.composeManyExtensions [
(self: super:
let
buildSystems = {
pyparsing = [ "flit-core" ];
hdwallets = [ "poetry" ];
pystarport = [ "poetry-core" ];
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
};
in
lib.mapAttrs
(attr: systems: super.${attr}.overridePythonAttrs
(old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems;
}))
buildSystems
)
(self: super: {
pyyaml-include = super.pyyaml-include.overridePythonAttrs {
preConfigure = ''
substituteInPlace setup.py --replace "setup()" "setup(version=\"1.3\")"
'';
overrides = poetry2nix.overrides.withDefaults (self: super:
let
buildSystems = {
pystarport = [ "poetry-core" ];
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
flake8-isort = [ "hatchling" ];
};
})
]);
in
lib.mapAttrs
(attr: systems: super.${attr}.overridePythonAttrs
(old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems;
}))
buildSystems
);
}

0 comments on commit 4029ffc

Please sign in to comment.