Skip to content

Commit

Permalink
Merge pull request #48 from kalmarek/mk/drop_1_0
Browse files Browse the repository at this point in the history
drop support for julia < 1.6
  • Loading branch information
Marek Kaluba authored Dec 6, 2023
2 parents 74b6fea + cf4a456 commit 57612e8
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 46 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
name: CI
on:
- push
- pull_request
push:
branches:
- main
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand All @@ -10,35 +19,23 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
file: ./lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
files: lcov.info
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
julia = "1"
julia = "1.6"

[extras]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "AbstractAlgebra"]
test = ["Test"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
The aim of this package is to standardize common assumptions on and functions for groups, i.e. to create
Group interface.
Packages using it include:
* [PermutationGroups.jl](https://github.com/kalmarek/PermutationGroups.jl)
* [Groups.jl](https://github.com/kalmarek/Groups.jl),
* [SymbolicWedderburn.jl](https://github.com/kalmarek/SymbolicWedderburn.jl),
* [Oscar](https://github.com/oscar-system/Oscar.jl) project.
Expand Down
7 changes: 2 additions & 5 deletions src/groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ function ngens(G::Group)
"Group does not seem to have generators. Did you alter `hasgens(::$(typeof(G)))`?",
)
end
if VERSION >=v"1.3.0"
rand_pseudo(G::Group, args...) = rand_pseudo(Random.default_rng(), G, args...)
else
rand_pseudo(G::Group, args...) = rand_pseudo(Random.GLOBAL_RNG, G, args...)
end

rand_pseudo(G::Group, args...) = rand_pseudo(Random.GLOBAL_RNG, G, args...)
rand_pseudo(rng::Random.AbstractRNG, G::Group, args...) = rand(rng, G, args...)
8 changes: 1 addition & 7 deletions test/cyclic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,13 @@ function Base.rand(
rs::Random.SamplerTrivial{<:CyclicGroup},
)
C = rs[]
return CyclicGroupElement(rand(0:C.order-1), C)
return CyclicGroupElement(rand(rng, 0:C.order-1), C)
end

GroupsCore.parent(c::CyclicGroupElement) = c.parent
Base.:(==)(g::CyclicGroupElement, h::CyclicGroupElement) =
parent(g) === parent(h) && g.residual == h.residual

# since CyclicGroupElement is isbits, there is no need to define for julia>=1.3.0
if VERSION < v"1.3.0"
Base.deepcopy_internal(g::CyclicGroupElement, ::IdDict) =
CyclicGroupElement(deepcopy(g.residual), parent(g))
end

Base.inv(g::CyclicGroupElement) =
(C = parent(g); CyclicGroupElement(order(UInt, C) - g.residual, C))

Expand Down
2 changes: 1 addition & 1 deletion test/infinite_cyclic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Base.rand(
rng::Random.AbstractRNG,
rs::Random.SamplerTrivial{<:InfCyclicGroup},
)
return InfCyclicGroupElement(rand(Int))
return InfCyclicGroupElement(rand(rng, Int))
end

GroupsCore.parent(c::InfCyclicGroupElement) = InfCyclicGroup()
Expand Down
7 changes: 0 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using GroupsCore
using Test
import AbstractAlgebra

include("conformance_test.jl")

Expand Down Expand Up @@ -29,11 +28,5 @@ include("infinite_cyclic.jl")
test_GroupElement_interface(rand(G, 2)...)
end

# @testset "Symmetric(5)" begin
# G = AbstractAlgebra.SymmetricGroup(5)
# test_Group_interface(G)
# test_GroupElement_interface(rand(G, 2)...)
# end

include("extensions.jl")
end
4 changes: 0 additions & 4 deletions test/test_notsatisfied.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ struct SomeGroupElement <: GroupElement
elts::Vector{Int} # SomeGroupElement is not isbits anymore
end

if VERSION < v"1.5.0"
contains(haystack, needle) = occursin(needle, haystack)
end

@testset "Exceptions" begin
@testset "InterfaceNotImplemented exception" begin
@test GroupsCore.InterfaceNotImplemented(
Expand Down

0 comments on commit 57612e8

Please sign in to comment.