Skip to content

Commit

Permalink
Merge branch 'master' into smaller-database and de-conflictify
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed Mar 8, 2022
2 parents 5fd2d09 + 719bfb4 commit 038fb36
Show file tree
Hide file tree
Showing 24 changed files with 484 additions and 169 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/install-dist.yml
@@ -0,0 +1,57 @@
on: [push, pull_request]
name: Dist installation

jobs:
build:
runs-on: 'macos-10.15'
steps:
- uses: actions/checkout@v2
- name: Setup Perl environment
uses: shogo82148/actions-setup-perl@v1
- name: Test and build
run: |
cpanm --quiet --notest ExtUtils::MakeMaker Test::Pod Test::Pod::Coverage parent
cpanm --quiet --notest File::ShareDir::Install XML::XPath DBM::Deep Digest::MD5
cpanm --quiet --notest File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https
cpanm --quiet --notest --installdeps .
perl Makefile.PL
./build-data.sh
make test
make dist
- uses: actions/upload-artifact@v2
with:
name: dist-for-installation-test
path: '*.tar.gz'
retention-days: 1
install-linux:
runs-on: 'ubuntu-latest'
needs: build
container:
image: perl:5.34
steps:
- uses: actions/download-artifact@v2
with:
name: dist-for-installation-test
- name: Install on Linux
run: |
cpanm *.tar.gz
install-openbsd:
runs-on: macos-10.15
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: dist-for-installation-test
- name: Install on OpenBSD
uses: cross-platform-actions/action@v0.3.1
with:
operating_system: openbsd
version: 6.9
shell: bash
run: |
mkdir dist-for-test &&
tar -C dist-for-test -xzf *.tar.gz &&
cd dist-for-test/* &&
cpan App::cpanminus &&
/home/runner/perl5/bin/cpanm --quiet --notest --installdeps . &&
/home/runner/perl5/bin/cpanm -v .
4 changes: 2 additions & 2 deletions .github/workflows/linux-without_uk-build.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
cpanm --quiet --notest Data::Dumper::Concise File::ShareDir::Install XML::XPath Data::CompactReadonly Digest::MD5 File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https
cpanm --quiet --notest --installdeps .
./build-data.sh
perl Makefile.PL --without_uk
perl Makefile.PL --without_uk INSTALL_BASE=$HOME/test_install
make test TEST_VERBOSE=1
make install
perl -MData::Dumper::Concise -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->isa("Number::Phone::StubCountry::GB")) { print "N::P built/installed correctly without N::P::UK\n".Dumper(\%INC); exit(0) } else { print "N::P build/install failed\n"; exit(1) }'
perl -I$HOME/test_install/lib/perl5 -MData::Dumper::Concise -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->isa("Number::Phone::StubCountry::GB")) { print "N::P built/installed correctly without N::P::UK\n".Dumper(\%INC); exit(0) } else { print "N::P build/install failed\n"; exit(1) }'
58 changes: 54 additions & 4 deletions CHANGELOG
@@ -1,8 +1,58 @@
XXXX-XX-XX XXXXXX Switch to Data::CompactReadonly for UK database
XXXXXX XXXX-XX-XX

XXXX-XX-XX XXXXXX Data updates;
Add deprecation warning for platforms with 32 bit int (support will
go away some time after 2023-06-01 with no further warning)
- Switch to Data::CompactReadonly for UK database

3.8004 2022-03-07

- Fix test failure that only occurred if Number::Phone::JP was installed
(it doesn't have exactly the data we expect from ...::StubCountry::JP)

- Data updates from OFCOM

3.8003 2022-03-05

- New Canadian area codes
- +882 34 recognised as Antarctica, via Global Networks Switzerland

3.8002 2021-12-06

- Fix Makefile.PL to not consume arguments that my code doesn't know about but
which are relevant to EU::MM (https://github.com/DrHyde/perl-modules-Number-Phone/pull/106)

- Explicitly open databases read-only so it works on a RO filesystem
(https://github.com/DrHyde/perl-modules-Number-Phone/issues/107)

- Data updates

3.8001 2021-09-21

- Tweak build to use more compatible options to tar(1) so some really old tars
can read the archive correctly

3.8000 2021-09-19

- Bugfix for numbers in local format which may be ambiguous for UK Crown Dependencies
when using Number::Phone::Lib

- Bugfix for when you ask for an object representing a number in one country
but provide a number for a different country. This mostly affects countries
that contain other jurisdictions squatting on parts of their number plan,
such as the Vatican in the Italian plan, and the Crown Dependencies in the UK
plan. It is now an error to ask for an object representing a number in a
'sub-country' which isn't valid in that sub-country (eg asking for a Jersey
object but passing a Guernsey number); but if you ask for an object representing
the 'super-country' but pass a 'sub-country' number you'll still get an object
representing the sub-country. ie, say "gimme a GB object for this 'ere Guernsey number"
and you'll get a Guernsey object.

- Data updates

3.7003 2021-06-02

- Data updates;

- Add deprecation warning for platforms with 32 bit int (support will
go away some time after 2023-06-01 with no further warning)

2021-03-09 3.7002 Data updates

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -95,6 +95,8 @@ t/source_data.t
buildtools/Number/Phone/BuildTools.pm
t/manifest-contains-all-modules.t
t/only-use-blib-under-make-test.t
t/deprecations.t
t/constructor.t
lib/Number/Phone/StubCountry/AC.pm
lib/Number/Phone/StubCountry/AD.pm
lib/Number/Phone/StubCountry/AE.pm
Expand Down
18 changes: 11 additions & 7 deletions Makefile.PL
Expand Up @@ -11,8 +11,8 @@ BEGIN {
shift @INC;
}

while(@ARGV) {
if(shift() eq '--without_uk') {
foreach my $arg (@ARGV) {
if($arg eq '--without_uk') {
$Number::Phone::BuildTools::without_uk++;
}
}
Expand All @@ -32,20 +32,19 @@ WriteMakefile(
},
VERSION_FROM => 'lib/Number/Phone.pm',
BUILD_REQUIRES => {
'ExtUtils::MakeMaker' => 6.52,
'ExtUtils::MakeMaker' => 6.64, # TEST_REQUIRES (CONFIGURE_REQUIRES is in 6.52; BUILD_REQUIRES in 6.56)
'ExtUtils::Manifest' => 0,
'ExtUtils::Install' => 0,
'File::ShareDir::Install' => 0.11,
'Parallel::ForkManager' => '0.7.6' # return data from child processes
},

CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 6.52,
'ExtUtils::MakeMaker' => 6.64,
'ExtUtils::Manifest' => 0,
'ExtUtils::Install' => 0,
'File::ShareDir::Install' => 0.11
},

PREREQ_PM => {
'Cwd' => 0,
'Data::CompactReadonly' => '0.0.3',
Expand All @@ -59,13 +58,18 @@ WriteMakefile(
'I18N::LangTags' => 0,
'I18N::LangTags::Detect' => 0,
'Scalar::Util' => 1.48,
},
TEST_REQUIRES => {
'Carp' => 0,
'Test::Differences' => 0.62,
'Test::More' => '0.96', # need done_testing (0.88) and subtests (0.95_01)
'Test::utf8' => 0,
'Test::Warnings' => 0,
'Devel::Hide' => 0,
'if' => 0,
},
dist => {
PREOP => "./build-data.sh --previouslibphonenumbertag"
PREOP => "./build-data.sh --previouslibphonenumbertag",
TARFLAGS => "--format ustar -c -v -f",
},
realclean => {
FILES => "cover_db"
Expand Down
90 changes: 60 additions & 30 deletions build-data.country-mapping
Expand Up @@ -146,8 +146,8 @@ foreach my $tuple (
[ 672 => ['AQ', 'NF' ]], # no AQ in libphonenumber
[ 7 => ['RU', 'KZ' ]],

# checked on 2020-12-04
# next check due 2021-12-01 (annually)
# checked on 2021-12-06
# next check due 2022-12-01 (annually)
[ 2125288 => 'EH' ], # see https://en.wikipedia.org/wiki/Telephone_numbers_in_Western_Sahara
[ 2125289 => 'EH' ], # see https://en.wikipedia.org/wiki/Telephone_numbers_in_Western_Sahara
[ 262269 => 'YT' ], # Mayotte fixed lines, see http://www.wtng.info/wtng-262-fr.html
Expand All @@ -158,33 +158,61 @@ foreach my $tuple (
[ 390549 => 'SM' ], # San Marino in Italian dialling plan, see https://en.wikipedia.org/wiki/Telephone_numbers_in_San_Marino

# sourced from libphonenumber
# checked on 2020-12-04
# next check due 2021-12-01 (annually)
[ 441481 => 'GG' ],
[ 447781 => 'GG' ],
[ 447839 => 'GG' ],
[ 447911 => 'GG' ],
[ 441624 => 'IM' ],
[ 447457 => 'IM' ],
[ 4474576 => 'IM' ],
[ 447524 => 'IM' ],
[ 447624 => 'IM' ],
[ 447924 => 'IM' ],
[ 441534 => 'JE' ],
[ 447509 => 'JE' ],
[ 447829 => 'JE' ],
[ 447937 => 'JE' ],
[ 447700 => 'JE' ],
[ 447797 => 'JE' ],
# checked on 2021-09-02
# next check due 2022-09-01 (annually)
(
map {
[ '44'.$_ => 'GG' ]
} (
1481, 7781, 7839, 79111, 79117
)
),
(
map {
[ '44'.$_ => 'IM' ]
} (
1624,
74576,
7524,
76240,
76241,
76242,
76243,
76244,
762450,
762456,
76246,
76248,
76249,
7924,
808162,
8440406, 8440906,
845624, 870624,
872299,
900624, 901624, 906624, 907624,
)
),
(
map {
[ '44'.$_ => 'JE' ]
} (
1534, 7509, 7829, 7937,
77003,
77007,
77008,
7797,
)
),

# see https://en.wikipedia.org/wiki/Telephone_numbers_in_Cura%C3%A7ao_and_the_Caribbean_Netherlands
# see https://en.wikipedia.org/wiki/Cocos_(Keeling)_Islands#Communications
# NB the company listed there for +61 406 went bust
# see http://wtng.info/ccod-6.html#CC61 (Christmas Island)
# 2G mobile only, no data: https://parksaustralia.gov.au/christmas/plan/phone-web/
# see https://en.wikipedia.org/wiki/Telephone_numbers_in_the_Australian_Antarctic_Territory
# see https://en.wikipedia.org/wiki/Telephone_numbers_in_Norfolk_Island
# checked on 2020-12-04
# next check due 2021-12-01 (annually)
# checked on 2021-12-0r64
# next check due 2022-12-01 (annually)
[ 5999 => 'CW' ], # Curacao
[ 6189162 => 'CC' ], # Cocos (Keeling) Islands
[ 6189164 => 'CX' ], # Christmas Island
Expand All @@ -196,8 +224,9 @@ foreach my $tuple (
[ 6723 => 'NF' ], # Norfolk Island

# see http://en.wikipedia.org/wiki/Telephone_numbers_in_Kazakhstan
# checked on 2020-12-04
# next check due 2022-12-01 (bi-annually)
# NB planned change to +997
# checked on 2021-12-06
# next check due 2022-12-01 (annually)
[ 76 => 'KZ' ],
[ 77 => 'KZ' ],

Expand All @@ -219,8 +248,8 @@ foreach my $tuple (
# see https://en.wikipedia.org/wiki/Global_Mobile_Satellite_System
# https://en.wikipedia.org/wiki/International_Networks_%28country_code%29
# wtng.info
# checked on 2019-12-11
# next check due 2021-12-01 (bi-annually)
# checked on 2022-03-04
# next check due 2024-12-01 (bi-annually)
[ 800 => 'InternationalFreephone' ],
[ 808 => 'SharedCostServices' ],
[ 870 => 'Inmarsat' ],
Expand All @@ -233,23 +262,24 @@ foreach my $tuple (
[ 881 => 'GMSS', ], # \ Sat-phones
[ 8810 => 'ICO', ], # |
[ 8811 => 'ICO', ], # |
# 8812 and 8813 assigned to Ellipso # |
# but that apparently never launched # |
# 8812 is vacant (Ellipso never launched) # |
# 8813 is vacant (Ellipso never launched) # |
# 8814 is spare # |
# 8815 is spare # |
[ 8816 => 'Iridium', ], # |
[ 8817 => 'Iridium', ], # |
[ 8818 => 'Globalstar', ], # |
[ 8819 => 'Globalstar', ], # /
[ 882 => 'InternationalNetworks' ], # many allocations not listed as I don't know if they're diallable, see wtng.info
[ 88213 => 'Telespazio' ], # Sat-ohone
[ 88213 => 'Telespazio' ], # Sat-phone
[ 88216 => 'Thuraya' ], # Sat-phone
[ 88220 => 'GarudaMobile' ], # Sat-phone
[ 88234 => 'AQ' ], # Antarctica, via Global Networks Switzerland, http://wtng.info/wtng-spe.html#Networks
[ 883 => 'InternationalNetworks' ],
[ 883120 => 'Telenor' ],
[ 883130 => 'Mobistar' ],
[ 883140 => 'MTTGlobalNetworks' ],
[ 8835100 => 'VOXBON' ],
# 8835100 => 'VOXBON' # decommissioned, https://en.wikipedia.org/wiki/International_Networks_%28country_code%29
[ 888 => 'TelecomsForDisasterRelief' ],
# 979 is used for testing when we fail to load a module when we
# know what "country" it is
Expand Down

0 comments on commit 038fb36

Please sign in to comment.