Skip to content

Commit f54ced4

Browse files
committed
ci!: 1.10 (lts) minimum version + complete CI
1 parent 3f3d0f4 commit f54ced4

File tree

18 files changed

+179
-144
lines changed

18 files changed

+179
-144
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@ on:
66
tags: ['*']
77
pull_request:
88
concurrency:
9-
# Skip intermediate builds: always.
10-
# Cancel intermediate builds: only if it is a pull request build.
119
group: ${{ github.workflow }}-${{ github.ref }}
1210
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1311
jobs:
12+
format:
13+
name: Code formatting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: julia-actions/setup-julia@v1
18+
with:
19+
version: '1'
20+
- uses: julia-actions/cache@v1
21+
- name: Install Runic
22+
run: julia -e 'using Pkg; Pkg.add("Runic")'
23+
- name: Check formatting
24+
run: julia -e 'using Runic; Runic.main(["--check", "src/", "test/", "docs/"])'
25+
1426
test:
15-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
27+
name: Test (${{ matrix.version }}; ${{ matrix.os }} ${{ matrix.arch }})
1628
runs-on: ${{ matrix.os }}
1729
strategy:
1830
fail-fast: false
1931
matrix:
2032
version:
21-
- '1.9'
33+
- '1.10'
2234
- 'nightly'
2335
os:
2436
- ubuntu-latest
@@ -33,8 +45,11 @@ jobs:
3345
- uses: julia-actions/cache@v1
3446
- uses: julia-actions/julia-buildpkg@v1
3547
- uses: julia-actions/julia-runtest@v1
48+
timeout-minutes: 10
3649
- uses: julia-actions/julia-processcoverage@v1
50+
if: matrix.version == '1.10' && matrix.os == 'ubuntu-latest'
3751
- uses: codecov/codecov-action@v3
52+
if: matrix.version == '1.10' && matrix.os == 'ubuntu-latest'
3853
with:
3954
files: lcov.info
4055
docs:

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
name = "KEGGAPI"
22
uuid = "e8256861-d17c-4800-bf17-838497555b93"
3-
authors = ["Nicholas Geoffrion", "Maria Victoria Aguilar Pontes"]
43
version = "1.0.0-DEV"
4+
authors = ["Nicholas Geoffrion", "Maria Victoria Aguilar Pontes", "Carlos Vigil-Vásquez"]
55

66
[deps]
77
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
88

99
[compat]
1010
HTTP = "1"
11-
julia = "1"
11+
julia = "1.10"
1212

1313
[extras]
14+
Runic = "62bfec6d-59d7-401d-8490-b29ee721c001"
1415
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1516

1617
[targets]
17-
test = ["Test"]
18+
test = ["Test", "Runic"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
![plot](./assets/logo/keggapi-logo.jpg)
22

3-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://bwbioinfo.github.io/KEGGAPI.jl/stable/)
4-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://bwbioinfo.github.io/KEGGAPI.jl/dev/)
5-
[![Build Status](https://github.com/bwbioinfo/KEGGAPI.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/bwbioinfo/KEGGAPI.jl/actions/workflows/CI.yml?query=branch%3Amain)
6-
[![Coverage](https://codecov.io/gh/bwbioinfo/KEGGAPI.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/bwbioinfo/KEGGAPI.jl)
3+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://cvigilv.github.io/KEGGAPI.jl/stable/)
4+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://cvigilv.github.io/KEGGAPI.jl/dev/)
5+
[![Build Status](https://github.com/cvigilv/KEGGAPI.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/cvigilv/KEGGAPI.jl/actions/workflows/CI.yml?query=branch%3Amain)
6+
[![Coverage](https://codecov.io/gh/cvigilv/KEGGAPI.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/cvigilv/KEGGAPI.jl)
77

88

99
KEGGAPI.jl is a Julia package for accesing the Kyoto Encyclopedia of Genes and Genomes, striving to take advantage of the speed and flexibility that Julia offers and make it accessible to the bioinformatics and functional annotation communities.

docs/make.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
using KEGGAPI
22
using Documenter
33

4-
DocMeta.setdocmeta!(KEGGAPI, :DocTestSetup, :(using KEGGAPI); recursive=true)
4+
DocMeta.setdocmeta!(KEGGAPI, :DocTestSetup, :(using KEGGAPI); recursive = true)
55

66
makedocs(;
7-
modules=[KEGGAPI],
8-
authors="Nicholas Geoffrion, Maria Victoria Aguilar Pontes",
9-
repo="https://github.com/bwbioinfo/KEGGAPI.jl/blob/{commit}{path}#{line}",
10-
sitename="KEGGAPI.jl",
11-
format=Documenter.HTML(;
12-
prettyurls=get(ENV, "CI", "false") == "true",
13-
canonical="https://bwbioinfo.github.io/KEGGAPI.jl",
14-
edit_link="main",
15-
assets=String[],
7+
modules = [KEGGAPI],
8+
authors = "Nicholas Geoffrion, Maria Victoria Aguilar Pontes, Carlos Vigil-Vásquez",
9+
repo = "https://github.com/cvigilv/KEGGAPI.jl/blob/{commit}{path}#{line}",
10+
sitename = "KEGGAPI.jl",
11+
format = Documenter.HTML(;
12+
prettyurls = get(ENV, "CI", "false") == "true",
13+
canonical = "https://cvigilv.github.io/KEGGAPI.jl",
14+
edit_link = "main",
15+
assets = String[],
1616
),
17-
pages=[
17+
pages = [
1818
"Home" => "index.md",
1919
"Manual" => Any[
2020
"Guide" => "man/guide.md",
@@ -26,6 +26,6 @@ makedocs(;
2626
)
2727

2828
deploydocs(;
29-
repo="github.com/bwbioinfo/KEGGAPI.jl",
30-
devbranch="main",
29+
repo = "github.com/cvigilv/KEGGAPI.jl",
30+
devbranch = "main",
3131
)

examples/example01.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ kegg_link = KEGGAPI.link("pathway", "dr");
7373
## Get an image
7474
kegg_image = KEGGAPI.get_image("hsa00010");
7575
## Save an image
76-
KEGGAPI.save_image(kegg_image, "image.png");
76+
KEGGAPI.save_image(kegg_image, "image.png");

src/Conv.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
"""
32
KEGGAPI.conv(<target_db>, <source_db>)
43
@@ -19,12 +18,11 @@ function conv(target_db::String, source_db::String)
1918
# Define the URL for the API request.
2019
url = "https://rest.kegg.jp/conv/$target_db/$source_db"
2120
response_text = request(url)
22-
kegg_data =
21+
kegg_data =
2322
conv_parser(
24-
response_text,
25-
url
26-
)
27-
# return the arrays
23+
response_text,
24+
url
25+
)
26+
# return the arrays
2827
return kegg_data
2928
end
30-

src/Find.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
"""
32
KEGGAPI.find(database, query) -> KeggTupleList
43
@@ -10,10 +9,10 @@ KEGGAPI.find("compound","glucose")
109
```
1110
"""
1211
function find(database::String, query::String, option::String = "")
13-
# This function retrieves a list of entries from a specific database from the KEGG API.
12+
# This function retrieves a list of entries from a specific database from the KEGG API.
1413
query = replace(query, " " => "+")
1514
# Check if the requested database is a "pathway" database
16-
if database in ["pathway","genes", "module", "orthology", "disease", "brite"]
15+
if database in ["pathway", "genes", "module", "orthology", "disease", "brite"]
1716
if option != ""
1817
throw(ArgumentError("The option argument is not available for pathway and genes databases"))
1918
end
@@ -34,7 +33,7 @@ function find(database::String, query::String, option::String = "")
3433
# If the database is not a pathway database, print a message indicating that the requested list is not available
3534
print("The find route you are looking for is not available")
3635
# Return an empty array
37-
kegg_data = []
36+
kegg_data = []
3837
end
3938
# Return the parsed data or an empty array if not available
4039
return kegg_data

src/Get.jl

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
"""
32
KEGGAPI.get(query, option) -> Vector
43
@@ -25,18 +24,18 @@ first(kegg_get_compounds)
2524
"""
2625
function kegg_get(query::Vector{String}, option::String = "")
2726
# This function retrieves a list of entries from a specific database from the KEGG API.
28-
27+
2928
# Set the chunk size for processing multiple elements in each request
3029
chunk_size = 10
31-
30+
3231
# Calculate the number of chunks needed to process all elements in the query
3332
query_elements = length(query)
3433
query_chunks = ceil(Int, query_elements / chunk_size)
35-
34+
3635
# Initialize arrays to store URLs and retrieved data
3736
urls = String[]
3837
data = String[]
39-
38+
4039
# Check if the option is "aaseq" or "ntseq"
4140
if option == "aaseq" || option == "ntseq"
4241
# If there are more than 10 queries, process in chunks
@@ -45,28 +44,28 @@ function kegg_get(query::Vector{String}, option::String = "")
4544
# Calculate start and end indices for the current chunk
4645
start_index = (i - 1) * chunk_size + 1
4746
end_index = min(i * chunk_size, query_elements)
48-
47+
4948
# Extract the current chunk of queries
5049
chunk = query[start_index:end_index]
51-
50+
5251
# Join the queries with "+" for URL construction
5352
chunk_query = join(chunk, "+")
54-
53+
5554
# Construct the URL for the API request
5655
url = "https://rest.kegg.jp/get/$chunk_query/$option"
57-
56+
5857
# Store the URL for reference
5958
push!(urls, url)
60-
59+
6160
# Request data from the URL
6261
response_text = request(url)
63-
62+
6463
# Process the response and extract data
6564
for datum in split(response_text, r"(\n>|^>)")[2:end]
6665
datum = replace(datum, r"\n$" => "")
67-
push!(data, ">"*datum)
66+
push!(data, ">" * datum)
6867
end
69-
68+
7069
# Introduce a delay before the next request
7170
sleep(0.1)
7271
end
@@ -78,7 +77,7 @@ function kegg_get(query::Vector{String}, option::String = "")
7877
push!(urls, url)
7978
for datum in split(response_text, r"(\n>|^>)")[2:end]
8079
datum = replace(datum, r"\n$" => "")
81-
push!(data, ">"*datum)
80+
push!(data, ">" * datum)
8281
end
8382
end
8483
else
@@ -88,28 +87,28 @@ function kegg_get(query::Vector{String}, option::String = "")
8887
# Calculate start and end indices for the current chunk
8988
start_index = (i - 1) * chunk_size + 1
9089
end_index = min(i * chunk_size, query_elements)
91-
90+
9291
# Extract the current chunk of queries
9392
chunk = query[start_index:end_index]
94-
93+
9594
# Join the queries with "+" for URL construction
9695
chunk_query = join(chunk, "+")
97-
96+
9897
# Construct the URL for the API request
9998
url = "https://rest.kegg.jp/get/$chunk_query/$option"
100-
99+
101100
# Store the URL for reference
102101
push!(urls, url)
103-
102+
104103
# Request data from the URL
105104
response_text = request(url)
106-
105+
107106
# Process the response and extract data
108107
response_text2 = replace(response_text, r"\n///([^/]*)$" => "")
109108
for datum in split(response_text2, "\n///\n")
110109
push!(data, datum)
111110
end
112-
111+
113112
# Introduce a delay before the next request
114113
sleep(0.1)
115114
end
@@ -125,10 +124,10 @@ function kegg_get(query::Vector{String}, option::String = "")
125124
end
126125
end
127126
end
128-
127+
129128
# Combine URLs and data into a single array
130129
kegg_data = [urls, data]
131-
130+
132131
# Return the parsed data or an empty array if not available
133132
return kegg_data
134133
end

src/Images.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ function save_image(image::Vector, filename::String)
3232
write(f, image)
3333
end
3434
return filename
35-
end
35+
end

src/Info.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ function info(database::String)
1717
response_text = request(url)
1818
# Return the lines as a string.
1919
return response_text
20-
end
20+
end

0 commit comments

Comments
 (0)