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

Refactor platformio fix ide #237313

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py
index 95e08108..6c2cfaed 100644
--- a/platformio/package/manifest/schema.py
+++ b/platformio/package/manifest/schema.py
@@ -276,9 +276,6 @@ class ManifestSchema(BaseSchema):
@@ -276,9 +276,6 @@
@staticmethod
@memoized(expire="1h")
def load_spdx_licenses():
Expand Down
165 changes: 165 additions & 0 deletions pkgs/development/python-modules/platformio/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{ stdenv, lib, python3
, fetchFromGitHub
, fetchPypi
, git
, spdx-license-list-data
, substituteAll
}:

with python3.pkgs; buildPythonPackage rec {
pname = "platformio";

version = "6.1.11";

# pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v${version}";
sha256 = "sha256-NR4UyAt8q5sUGtz1Sy6E8Of7y9WrH9xpcAWzLBeDQmo=";
};

# outputs = [ "out" ];

patches = [
# ../../embedded/platformio/fix-searchpath.patch
(substituteAll {
src = ../../embedded/platformio/use-local-spdx-license-list.patch;
spdx_license_list_data = spdx-license-list-data.json;
})
../../embedded/platformio/missing-udev-rules-nixos.patch
];

postPatch = ''
substituteInPlace setup.py \
--replace 'aiofiles==%s" % ("0.8.0" if PY36 else "22.1.*")' 'aiofiles"' \
--replace 'starlette==%s" % ("0.19.1" if PY36 else "0.23.*")' 'starlette"' \
--replace 'uvicorn==%s" % ("0.16.0" if PY36 else "0.22.*")' 'uvicorn"' \
--replace 'tabulate==%s" % ("0.8.10" if PY36 else "0.9.*")' 'tabulate>=0.8.10,<=0.9"' \
--replace 'wsproto==%s" % ("1.0.0" if PY36 else "1.2.*")' 'wsproto"'
'';

propagatedBuildInputs = [
aiofiles
ajsonrpc
bottle
click
click-completion
colorama
git
lockfile
marshmallow
pyelftools
pyserial
requests
semantic-version
spdx-license-list-data.json
starlette
tabulate
uvicorn
wsproto
zeroconf
];

preCheck = ''
export HOME=$(mktemp -d)
export PATH=$PATH:$out/bin
'';

nativeCheckInputs = [
jsondiff
pytestCheckHook
];

disabledTestPaths = [
"tests/commands/pkg/test_install.py"
"tests/commands/pkg/test_list.py"
"tests/commands/pkg/test_outdated.py"
"tests/commands/pkg/test_search.py"
"tests/commands/pkg/test_show.py"
"tests/commands/pkg/test_uninstall.py"
"tests/commands/pkg/test_update.py"
"tests/commands/test_boards.py"
"tests/commands/test_check.py"
"tests/commands/test_platform.py"
"tests/commands/test_run.py"
"tests/commands/test_test.py"
"tests/misc/test_maintenance.py"
# requires internet connection
"tests/misc/ino2cpp/test_ino2cpp.py"
];

disabledTests = [
# requires internet connection
"test_api_cache"
"test_ping_internet_ips"
];

pytestFlagsArray = [
"tests"
] ++ (map (e: "--deselect tests/${e}") [
"commands/pkg/test_exec.py::test_pkg_specified"
"commands/pkg/test_exec.py::test_unrecognized_options"
"commands/test_ci.py::test_ci_boards"
"commands/test_ci.py::test_ci_build_dir"
"commands/test_ci.py::test_ci_keep_build_dir"
"commands/test_ci.py::test_ci_lib_and_board"
"commands/test_ci.py::test_ci_project_conf"
"commands/test_init.py::test_init_custom_framework"
"commands/test_init.py::test_init_duplicated_boards"
"commands/test_init.py::test_init_enable_auto_uploading"
"commands/test_init.py::test_init_ide_atom"
"commands/test_init.py::test_init_ide_clion"
"commands/test_init.py::test_init_ide_eclipse"
"commands/test_init.py::test_init_ide_vscode"
"commands/test_init.py::test_init_incorrect_board"
"commands/test_init.py::test_init_special_board"
"commands/test_lib.py::test_global_install_archive"
"commands/test_lib.py::test_global_install_registry"
"commands/test_lib.py::test_global_install_repository"
"commands/test_lib.py::test_global_lib_list"
"commands/test_lib.py::test_global_lib_uninstall"
"commands/test_lib.py::test_global_lib_update"
"commands/test_lib.py::test_global_lib_update_check"
"commands/test_lib.py::test_install_duplicates"
"commands/test_lib.py::test_lib_show"
"commands/test_lib.py::test_lib_stats"
"commands/test_lib.py::test_saving_deps"
"commands/test_lib.py::test_search"
"commands/test_lib.py::test_update"
"commands/test_lib_complex.py::test_global_install_archive"
"commands/test_lib_complex.py::test_global_install_registry"
"commands/test_lib_complex.py::test_global_install_repository"
"commands/test_lib_complex.py::test_global_lib_list"
"commands/test_lib_complex.py::test_global_lib_uninstall"
"commands/test_lib_complex.py::test_global_lib_update"
"commands/test_lib_complex.py::test_global_lib_update_check"
"commands/test_lib_complex.py::test_install_duplicates"
"commands/test_lib_complex.py::test_lib_show"
"commands/test_lib_complex.py::test_lib_stats"
"commands/test_lib_complex.py::test_search"
"package/test_manager.py::test_download"
"package/test_manager.py::test_install_force"
"package/test_manager.py::test_install_from_registry"
"package/test_manager.py::test_install_lib_depndencies"
"package/test_manager.py::test_registry"
"package/test_manager.py::test_uninstall"
"package/test_manager.py::test_update_with_metadata"
"package/test_manager.py::test_update_without_metadata"
"test_builder.py::test_build_flags"
"test_builder.py::test_build_unflags"
"test_builder.py::test_debug_custom_build_flags"
"test_builder.py::test_debug_default_build_flags"
"test_misc.py::test_api_cache"
"test_misc.py::test_ping_internet_ips"
"test_misc.py::test_platformio_cli"
"test_pkgmanifest.py::test_packages"
]);

meta = with lib; {
description = "An open source ecosystem for IoT development";
homepage = "https://platformio.org";
license = licenses.asl20;
maintainers = with maintainers; [ mog makefu ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9547,6 +9547,8 @@ self: super: with self; {

platformdirs = callPackage ../development/python-modules/platformdirs { };

platformio = callPackage ../development/python-modules/platformio { };

playsound = callPackage ../development/python-modules/playsound { };

plexapi = callPackage ../development/python-modules/plexapi { };
Expand Down