Skip to content

Commit

Permalink
Fix issue with Perl>5.36 (#509)
Browse files Browse the repository at this point in the history
* add dockerfile for AGAT with perl version 536

* replace export_to_level(2,@_) in each module called by AGAT::AGAT by AGAT::Module->export_to_level(1,@_) from AGAT::AGAT. This fix issiue related to replace export_to_level(2,@_) introduced in perl 5.36. Fix #416 #392

* add test for perl>5.36

* remove indentation in shebang

* add missing semicolon

* run make test for first job
  • Loading branch information
Juke34 authored Dec 3, 2024
1 parent b0d72eb commit 4ca5e04
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 49 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,51 @@ concurrency:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:

# This workflow contains a second job called "build2"
build_perl536:
# avoid to run twice push and PR
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

# The type of runner that the job will run on
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install libdb-dev
run: sudo apt-get -y install libdb-dev
- name: Install R
run: sudo apt-get -y install r-base

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
#- name: Checkout AGAT
- uses: actions/checkout@v2
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.36'
install-modules-with: cpanm
install-modules-args: --notest --force
install-modules: File::ShareDir::Install
- uses: webiny/action-post-run@2.0.1
id: post-run-command
if: ${{ failure() }}
with:
run: cat /home/runner/.cpanm/build.log
- name: install AGAT deps
run: cpanm --installdeps --notest --force .
- name: test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make test

# This workflow contains a first job called "build"
build_perl530:
# avoid to run twice push and PR
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

#container:
# image: perl:5.30
Expand Down Expand Up @@ -51,4 +89,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEVEL_COVER_OPTIONS: "+ignore,^local/"
run: cover -test -report Coveralls
run: cover -test -report Coveralls
4 changes: 2 additions & 2 deletions bin/agat_sp_load_function_from_protein_align.pl
Original file line number Diff line number Diff line change
Expand Up @@ -840,10 +840,10 @@ sub check_gene_overlap_gffAlign{
my ($hash_omniscient, $prot_omniscient, $gene_id, $gene_id2, $prot_tag)=@_;

# my $overlap12=undef;
my $overlap12_abs=undef
my $overlap12_abs=undef;

# my $w_overlap12=undef;
my $w_overlap12_abs=undef
my $w_overlap12_abs=undef;

# my $overlap21=undef;
my $overlap21_abs=undef;
Expand Down
9 changes: 9 additions & 0 deletions docker/dockerfile_perl536
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
From perl:5.36

RUN cpanm install BioPerl Graph::Directed LWP::UserAgent Carp Sort::Naturally File::Share File::ShareDir::Install Moose YAML LWP::Protocol::https Term::ProgressBar
RUN git clone https://github.com/NBISweden/AGAT.git
WORKDIR /usr/src/app/AGAT
RUN perl Makefile.PL
RUN make
RUN make test
RUN make install
10 changes: 9 additions & 1 deletion lib/AGAT/AGAT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ our $VERSION = "v1.4.1";
our @ISA = qw(Exporter);
our @EXPORT = qw(get_agat_header print_agat_version get_agat_config handle_levels);
sub import {
AGAT::AGAT->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::AGAT->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientI->export_to_level(1, @_);
AGAT::OmniscientO->export_to_level(1, @_);
AGAT::OmniscientTool->export_to_level(1, @_);
AGAT::Config->export_to_level(1, @_);
AGAT::Levels->export_to_level(1, @_);
AGAT::OmniscientStat->export_to_level(1, @_);
AGAT::Utilities->export_to_level(1, @_);
AGAT::PlotR->export_to_level(1, @_);
}

=head1 SYNOPSIS
Expand Down
4 changes: 0 additions & 4 deletions lib/AGAT/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ use Exporter;

our @ISA = qw(Exporter);
our @EXPORT = qw( load_config expose_config_file check_config get_config expose_config_hash );
sub import {
AGAT::Config->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::Config->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
Expand Down
4 changes: 0 additions & 4 deletions lib/AGAT/Levels.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ use Exporter;

our @ISA = qw(Exporter);
our @EXPORT = qw( get_levels_info load_levels expose_levels get_feature_type_by_agat_value );
sub import {
AGAT::Levels->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::Levels->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
Expand Down
4 changes: 0 additions & 4 deletions lib/AGAT/OmniscientI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ our @ISA = qw(Exporter);
our @EXPORT = qw(get_level select_gff_format
modelate_utr_and_cds_features_from_exon_features_and_cds_start_stop
slurp_gff3_file_JD);
sub import {
AGAT::OmniscientI->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientI->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
Expand Down
7 changes: 1 addition & 6 deletions lib/AGAT/OmniscientO.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/perl -w

package AGAT::OmniscientO;

Expand All @@ -18,11 +18,6 @@ our @EXPORT = qw(print_ref_list_feature print_omniscient print_omniscient_as_mat
print_omniscient_from_level1_id_list webapollo_compliant embl_compliant
convert_omniscient_to_ensembl_style write_top_features prepare_gffout prepare_fileout);

sub import {
AGAT::OmniscientO->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientO->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
This is the code to output data store in Omniscient.
Expand Down
5 changes: 0 additions & 5 deletions lib/AGAT/OmniscientStat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw( print_omniscient_statistics );

sub import {
AGAT::OmniscientStat->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientStat->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
This is the code to perform statisctis of data store in Omniscient.
Expand Down
5 changes: 0 additions & 5 deletions lib/AGAT/OmniscientToGTF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(print_omniscient_as_gtf);

sub import {
AGAT::OmniscientToGTF->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientToGTF->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

# --------------------------- INFO ---------------------------
# Set GTF version definitions
#my @GTF3 = ("gene", "transcript", "exon", "CDS", "Selenocysteine", "start_codon", "stop_codon", "three_prime_utr", "five_prime_utr");
Expand Down
5 changes: 0 additions & 5 deletions lib/AGAT/OmniscientTool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ remove_l1_and_relatives remove_l2_and_relatives remove_l3_and_relatives get_long
check_mrna_positions check_features_overlap initialize_omni_from clean_clone
create_omniscient get_cds_from_l2 merge_overlap_loci get_uniq_id );

sub import {
AGAT::OmniscientTool->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::OmniscientTool->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
This is the code to handle data store in Omniscient.
Expand Down
4 changes: 0 additions & 4 deletions lib/AGAT/PlotR.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ use AGAT::Utilities;

our @ISA = qw(Exporter);
our @EXPORT = qw(execute_R_command rcc_density_one_row_per_file rcc_plot_from_list may_i_plot);
sub import {
AGAT::PlotR->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::PlotR->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
Expand Down
5 changes: 0 additions & 5 deletions lib/AGAT/Utilities.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ our @EXPORT = qw(exists_keys exists_undef_value get_proper_codon_table surround_
sizedPrint activate_warning_limit print_time dual_print file_text_line print_wrap_text
string_sep_to_hash);

sub import {
AGAT::Utilities->export_to_level(1, @_); # to be able to load the EXPORT functions when direct call; (normal case)
AGAT::Utilities->export_to_level(2, @_); # to be able to load the EXPORT functions when called from one level up;
}

=head1 SYNOPSIS
package containing utility tools
Expand Down

0 comments on commit 4ca5e04

Please sign in to comment.