From 247e3b91c965be6b6b303381aa92b70d7bffc81b Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Tue, 29 Oct 2024 01:14:38 +0000 Subject: [PATCH 1/5] CompatHelper: bump compat for QEDcore to 0.2, (keep existing compat) --- Project.toml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 902728b..174ccd8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,30 +1,24 @@ name = "QuantumElectrodynamics" uuid = "bb1fba1d-cf9b-41b3-874e-4b81465537b9" -authors = [ - "Uwe Hernandez Acosta ", - "Simeon Ehrig", - "Klaus Steiniger", - "Tom Jungnickel", - "Anton Reinhard", -] +authors = ["Uwe Hernandez Acosta ", "Simeon Ehrig", "Klaus Steiniger", "Tom Jungnickel", "Anton Reinhard"] version = "0.1.0" [deps] -Reexport = "189a3867-3050-52da-a836-e630ba90ab69" QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93" QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e" QEDevents = "fc3ce04a-5be5-4f3a-acff-eceaab723759" QEDfields = "ac3a6c97-e859-4b9f-96bb-63d2a216042c" QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad" +Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] -julia = "1.10" -Reexport = "^1.2" QEDbase = "0.2.2" -QEDcore = "0.1" +QEDcore = "0.1, 0.2" QEDevents = "0.1" QEDfields = "0.1" QEDprocesses = "0.2" +Reexport = "^1.2" +julia = "1.10" [extras] SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" From 194664062f102803f53fda328701f12dd206c088 Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Tue, 29 Oct 2024 08:27:15 +0100 Subject: [PATCH 2/5] fix QEDcore and QEDbase versions --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 174ccd8..a6971f0 100644 --- a/Project.toml +++ b/Project.toml @@ -12,8 +12,8 @@ QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] -QEDbase = "0.2.2" -QEDcore = "0.1, 0.2" +QEDbase = "0.3" +QEDcore = "0.2" QEDevents = "0.1" QEDfields = "0.1" QEDprocesses = "0.2" From b664abca2c7378ef91aad7fbf08a5a190a33f752 Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Tue, 29 Oct 2024 08:30:01 +0100 Subject: [PATCH 3/5] update CI doc build job --- .github/workflows/BuildDeployDoc.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/BuildDeployDoc.yml b/.github/workflows/BuildDeployDoc.yml index 9a4f334..a1662e9 100644 --- a/.github/workflows/BuildDeployDoc.yml +++ b/.github/workflows/BuildDeployDoc.yml @@ -18,14 +18,17 @@ jobs: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: - version: "1.10" - - name: set dependencies to dev branch version + version: '1.10' + - name: clone integration test tools run: | - $(julia --project=. .ci/integTestGen/src/get_project_name_version_path.jl) + git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/ + - name: set dev dependencies + run: | + $(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl) echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME" echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION" echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH" - julia --project=docs/ .ci/SetupDevEnv/src/SetupDevEnv.jl + julia --project=docs/ /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl julia --project=docs/ -e 'import Pkg; Pkg.instantiate()' - name: Build and deploy env: From 775838504f0c35b90d02b07d235bf6803ad374df Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Tue, 29 Oct 2024 11:38:35 +0100 Subject: [PATCH 4/5] fix bug in calculate_linear_dependency_ordering() Before, the function only returned dependencies, which was defined in required_dependencies. Now, the function also returns dependencies, which are (implicit) dependencies of the dependencies looking for. Example: required_dependencies=["QEDfields"] returned before: ["QEDfields"] returns now: ["QEDbase", "QEDcore", "QEDfields"] --- .ci/SetupDevEnv/src/SetupDevEnv.jl | 30 ++++++++++++-- .ci/SetupDevEnv/test/runtests.jl | 63 ++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/.ci/SetupDevEnv/src/SetupDevEnv.jl b/.ci/SetupDevEnv/src/SetupDevEnv.jl index c76254d..300a83f 100644 --- a/.ci/SetupDevEnv/src/SetupDevEnv.jl +++ b/.ci/SetupDevEnv/src/SetupDevEnv.jl @@ -513,14 +513,38 @@ function calculate_linear_dependency_ordering( @info "calculate linare ordering to add QED packages" linear_pkg_ordering = Vector{String}() - for init_level in package_dependecy_list + # First we search for the highest level containing a required dependency + # All dependencies in the levels below the highest level needs to be installed + # and there be part of the output. + highest_level = 0 + + for level in 1:length(package_dependecy_list) for required_dep in required_dependencies - if required_dep in init_level - push!(linear_pkg_ordering, required_dep) + if required_dep in package_dependecy_list[level] + highest_level = level end end end + # could not find required dependency + if highest_level == 0 + return linear_pkg_ordering + end + + # copy complete level + for level in 1:(highest_level - 1) + for pkg in package_dependecy_list[level] + push!(linear_pkg_ordering, pkg) + end + end + + # copy only the dependencies from the highest_level, which are required + for pkg in package_dependecy_list[highest_level] + if pkg in required_dependencies + push!(linear_pkg_ordering, pkg) + end + end + with_logger(debuglogger) do @debug "linear ordering of QED packages to add: $(linear_pkg_ordering)" end diff --git a/.ci/SetupDevEnv/test/runtests.jl b/.ci/SetupDevEnv/test/runtests.jl index 485d07b..d95d069 100644 --- a/.ci/SetupDevEnv/test/runtests.jl +++ b/.ci/SetupDevEnv/test/runtests.jl @@ -127,3 +127,66 @@ using Test # end # end end + +@testset "calculate_linear_dependency_ordering()" begin + pkg_dependecy_list = Vector{Set{String}}() + push!(pkg_dependecy_list, Set(["QEDbase"])) + push!(pkg_dependecy_list, Set(["QEDcore"])) + push!(pkg_dependecy_list, Set(["QEDevents", "QEDfields", "QEDprocesses"])) + push!(pkg_dependecy_list, Set(["QuantumElectrodynamics"])) + + # For the real world code, it does not matter what is the ordering of + # entries in a set. + # For the tests it does matter. + # Therefore the current expected behavoir if we create a list from a set + # is, that the output list has the same odering than the input list. + # This behavior is implementation depend and can change + @test [a for a in Set(["QEDevents", "QEDfields", "QEDprocesses"])] == ["QEDevents", "QEDfields", "QEDprocesses"] + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["NotInclude"] + ) == [] + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDbase"] + ) == ["QEDbase"] + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDbase", "QEDcore"] + ) == ["QEDbase", "QEDcore"] + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDcore"] + ) == ["QEDbase", "QEDcore"] + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDfields"] + ) == ["QEDbase", "QEDcore", "QEDfields"] + + expected_processes_fields = vcat( + ["QEDbase", "QEDcore"], [a for a in Set(["QEDfields", "QEDprocesses"])] + ) + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDprocesses", "QEDfields"] + ) == expected_processes_fields + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDfields", "QEDprocesses"] + ) == expected_processes_fields + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QEDcore", "QEDfields"] + ) == ["QEDbase", "QEDcore", "QEDfields"] + + # needs to be constructed from a set, because how a set is iterated is + # implementation depend + expected_QuantumElectrodynamics = vcat( + ["QEDbase", "QEDcore"], + [a for a in Set(["QEDevents", "QEDfields", "QEDprocesses"])], + ["QuantumElectrodynamics"], + ) + + @test SetupDevEnv.calculate_linear_dependency_ordering( + pkg_dependecy_list, ["QuantumElectrodynamics"] + ) == expected_QuantumElectrodynamics +end From dac2aa6ae5d2bc6a8bb2e8bafbe887535afaf4bf Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Tue, 29 Oct 2024 11:41:21 +0100 Subject: [PATCH 5/5] do not git clone QuantumElectrodynamics.jl in the CI documentation build job --- .github/workflows/BuildDeployDoc.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/BuildDeployDoc.yml b/.github/workflows/BuildDeployDoc.yml index a1662e9..3506ad2 100644 --- a/.github/workflows/BuildDeployDoc.yml +++ b/.github/workflows/BuildDeployDoc.yml @@ -19,16 +19,13 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: '1.10' - - name: clone integration test tools - run: | - git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/ - name: set dev dependencies run: | - $(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl) + $(julia --project=. .ci/integTestGen/src/get_project_name_version_path.jl) echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME" echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION" echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH" - julia --project=docs/ /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl + julia --project=docs/ .ci/SetupDevEnv/src/SetupDevEnv.jl julia --project=docs/ -e 'import Pkg; Pkg.instantiate()' - name: Build and deploy env: