commit 65e871a4f7509d9d05b2fe505f560831ff824cc6331bd2100c412741e810654e Author: Tina Müller Date: Thu Jan 9 16:30:30 2025 +0000 - updated to 0.490.0 (0.49) see /usr/share/doc/packages/perl-Specio/Changes 0.49 2024-12-23 - Attempting to import any structured type caused a confusing "Can't store CODE items" error. Reported by Kerin Millar. - Removed the "this is alpha" warning from Specio::Library::Structured. Given that I don't plan on making any major changes to this module, it's as production-ready as it's going to get. OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Specio?expand=0&rev=28 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Specio-0.48.tar.gz b/Specio-0.48.tar.gz new file mode 100644 index 0000000..7f3e3c1 --- /dev/null +++ b/Specio-0.48.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c85793580f1274ef08173079131d101f77b22accea7afa8255202f0811682b2 +size 108298 diff --git a/Specio-0.49.tar.gz b/Specio-0.49.tar.gz new file mode 100644 index 0000000..7f26053 --- /dev/null +++ b/Specio-0.49.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e85766262b3738efc8dcbeb039b0d632d0aa393a55a33c36df5b21b4d44dc7af +size 108356 diff --git a/cpanspec.yml b/cpanspec.yml new file mode 100644 index 0000000..b9bbec8 --- /dev/null +++ b/cpanspec.yml @@ -0,0 +1,29 @@ +--- +#description_paragraphs: 3 +#description: |- +# override description from CPAN +#summary: override summary from CPAN +#no_testing: broken upstream +#sources: +# - source1 +# - source2 +#patches: +# foo.patch: -p1 +# bar.patch: +#preamble: |- +# BuildRequires: gcc-c++ +#post_prep: |- +# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` +# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL +#post_build: |- +# rm unused.files +#post_install: |- +# sed on %{name}.files +#license: SUSE-NonFree +#skip_noarch: 1 +#custom_build: |- +#./Build build flags=%{?_smp_mflags} --myflag +#custom_test: |- +#startserver && make test +#ignore_requires: Bizarre::Module +skip_doc: precious.toml|azure-pipelines.yml diff --git a/perl-Specio.changes b/perl-Specio.changes new file mode 100644 index 0000000..5805acf --- /dev/null +++ b/perl-Specio.changes @@ -0,0 +1,315 @@ +------------------------------------------------------------------- +Tue Dec 24 05:34:28 UTC 2024 - Tina Müller + +- updated to 0.490.0 (0.49) + see /usr/share/doc/packages/perl-Specio/Changes + + 0.49 2024-12-23 + + - Attempting to import any structured type caused a confusing "Can't store CODE items" + error. Reported by Kerin Millar. + - Removed the "this is alpha" warning from Specio::Library::Structured. Given that I don't plan on + making any major changes to this module, it's as production-ready as it's going to get. + +------------------------------------------------------------------- +Sun Jun 12 03:07:32 UTC 2022 - Tina Müller + +- updated to 0.48 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.48 2022-06-11 + + - Importing types into a class which inherited from another class that had + imported types wouldn't work, leaving the child class with no `t()` + sub. Patch by Kerin Millar. + +------------------------------------------------------------------- +Tue Feb 16 10:24:24 UTC 2021 - Dirk Stoecker + +- updated to 0.47 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.47 2021-01-29 + + - Change Specio constraint object's stringification overloading to return the + type name rather than the default Perl object stringification, which gives + you something like + "Specio::Constraint::Parameterized=HASH(0x564d258efb48)". Anonymous are + special cased to return something you can print. + + - All types now overload the `eq` comparison operator. Moose expects types to + be comparable in this manner when doing role summation. This fixes a bug + reported by Martin Gruner. GH #18. + +------------------------------------------------------------------- +Sun Mar 15 03:13:38 UTC 2020 - + +- updated to 0.46 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.46 2020-03-14 + + - No code changes, just fixing a mistake in the POD. Reported by Petr + Pisar. Fixes #17. + + + 0.45 2019-11-24 + + - Made XString a prereq if installing with Perl 5.10+. + +------------------------------------------------------------------- +Thu Aug 15 05:29:05 UTC 2019 - Stephan Kulow + +- updated to 0.44 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.44 2019-08-14 + + - Replaced the use of B with XString if it is installed. The latter is much + smaller and provides the one subroutine from B we cared about. Based on GH + #15. Implemented by Nicolas R. + +------------------------------------------------------------------- +Thu Nov 8 06:56:40 UTC 2018 - Stephan Kulow + +- updated to 0.43 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.43 2018-10-26 + + - Optimized compile-time operations to make Specio itself quicker to + load. Specio's load time is a non-trivial part of the load time of DateTime + (and presumably other things that use it). Based on + https://github.com/houseabsolute/DateTime.pm/issues/85. Reported by + versable. + +------------------------------------------------------------------- +Sun Nov 5 07:02:33 UTC 2017 - coolo@suse.com + +- updated to 0.42 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.42 2017-11-04 + + - The Perl library claimed it provided types named LaxVersionStr and + StrictVersionStr but they were really named LaxVersion and + StrictVersion. The names have now been fixed to match the documentation, so + they are LaxVersionStr and StrictVersionStr. + + + 0.41 2017-11-04 + + - Fixed checks for whether a class is loaded in light of upcoming optimization + in Perl 5.28. Fixed by Sprout (GH #12). + +------------------------------------------------------------------- +Tue Aug 15 06:12:44 UTC 2017 - coolo@suse.com + +- updated to 0.40 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.40 2017-08-03 + + - Fixed more bugs with {any,object}_{can,does,isa}_type. When passed a glob + (not a globref) they would die in their type check. On Perl 5.16 or earlier, + passing a number to an any_* type would also die. + + - Fixed subification overloading. If Sub::Quote was loaded, this would be + used, but any environment variables needed for the closure would not be + included. This broke enums, among other things. + +------------------------------------------------------------------- +Thu Aug 3 06:12:28 UTC 2017 - coolo@suse.com + +- updated to 0.39 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.39 2017-08-02 + + - Many bug fixes and improves to the types created by + {any,object}_{can,does,isa}_type. In some cases, an invalid value could + cause an exception in type check itself. In other cases, a value which + failed a type check would cause an exception when generating a message + describing the failure. These cases have all been fixed. + + - The messages describing a failure for all of these types have been improved. + + - You can now create anonymous *_does and *_isa types using the exports from + Specio::Declare. + +------------------------------------------------------------------- +Sun Jul 2 06:13:44 UTC 2017 - coolo@suse.com + +- updated to 0.38 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.38 2017-07-01 + + - Simplify checks for overloading to not call overload::Overloaded(). Just + checking the return value of overload::Method() is sufficient. + +------------------------------------------------------------------- +Wed May 10 06:36:21 UTC 2017 - coolo@suse.com + +- updated to 0.37 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.37 2017-05-09 + + - Possible fix for very weird failures seen under threaded Perls with some + modules that use Specio. + +------------------------------------------------------------------- +Mon Feb 20 07:27:28 UTC 2017 - coolo@suse.com + +- updated to 0.36 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.36 2017-02-19 + + - Inlined coercions would attempt to coerce for every type which matched the + value given, instead of stopping after the first type. Fixed by Graham Knop + (GH #11). + + - Inlined coercions did not include the inline environment variables needed by + the type from which the coercion was being performed. Fixed by Graham Knop + (GH #8). + + - When you use the same type repeatedly as coderef (for example, as a + constraint with Moo), it will only generated its subified form once, rather + than regenerating it each time it is de-referenced. + + - Added an API to Specio::Subs to allow you to combine type libraries and + helper subs in one package for exporting. See the Specio::Exporter docs for + more details. + +------------------------------------------------------------------- +Mon Feb 13 13:07:06 UTC 2017 - coolo@suse.com + +- updated to 0.35 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.35 2017-02-12 + + - Added Specio::Subs, a module which allows you to turn one or more library's + types into subroutines like is_Int() and to_Int(). + + - Added an inline_coercion method to Specio constraints. + + + 0.34 2017-01-29 + + - Packages with Specio::Exporter as their parent can now specify additional + arbitrary subs to exporter. See the Specio::Exporter docs for details. + + - Importing the same library twice in a given package would throw an + exception. The second attempt to import is now ignored. + + - Added an alpha implementation of structured types. See + Specio::Library::Structured for details. + + + 0.33 2017-01-24 + + - Fixed a mistake in the SYNOPSIS for Specio::Declare. The example for the + *_isa_type helpers was not correct. + + - Removed the alpha warning from the docs. This is being used by enough of my + modules on CPAN that I don't plan on doing any big breaking changes without + a deprecation first. + + + 0.32 2017-01-12 + + - Fixed a bug in the inlining for types create by any_can_type() and + object_can_type(). This inlining mostly worked by accident because of some + List::Util XS magic, but this broke under the debugger. Reported by + Christian Walde (GH #6) and Chan Wilson + (https://github.com/houseabsolute/DateTime.pm/issues/49). + +------------------------------------------------------------------- +Mon Nov 7 07:18:01 UTC 2016 - coolo@suse.com + +- updated to 0.31 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.31 2016-11-05 + + - The stack trace contained by Specio::Exception objects no longer includes a + stack frames for the Specio::Exception package. + + - Made the inline_environment() and description() methods public on type and + coercion objects. + +------------------------------------------------------------------- +Sun Oct 16 05:59:49 UTC 2016 - coolo@suse.com + +- updated to 0.30 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.30 2016-10-15 + + - Fix a bug with the Sub::Quoted sub returned by $type->coercion_sub. If a + type had more than one coercion, the generated sub could end up coercing the + value to undef some of the time. Depending on hash key ordering, this could + end up being a heisenbug that only occured some of the time. + +------------------------------------------------------------------- +Mon Oct 10 06:02:10 UTC 2016 - coolo@suse.com + +- updated to 0.29 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.29 2016-10-09 + + - Doc Specio::PartialDump because you may want to use it as part of the + failure message generation code for a type. + +------------------------------------------------------------------- +Sat Oct 8 16:46:29 UTC 2016 - coolo@suse.com + +- updated to 0.28 + see /usr/share/doc/packages/perl-Specio/Changes + + 0.28 2016-10-02 + + - Added a Test::Specio module to provide helpers for testing Specio libraries. + + - Fixed another bug with a subtype of special types and inlining. + + + 0.27 2016-10-01 + + - Cloning a type with coercions defined on it would cause an exception. + + - Creating a subtype of a special type created by *_isa_type, *_can_type, or + *_does_type, or enum would die when trying to inline the type constraint. + + - Removed the never-documented Any type. + + - Added documentation for each type in Specio::Library::Builtins. + + + 0.26 2016-09-24 + + - Require Role::Tiny 1.003003. This should fix the test failures some + CPANTesters reported with this error: + + Can't resolve method "???" overloading "&{}" in package + "Specio::Constraint::Simple" at Specio::Constraint::Simple->new line 35. + + + 0.25 2016-09-04 + + - Calling {any,object}_{isa,does}_type repeatedly in a package with the same + class or role name would die. These subs are now special-cased to simply + return an existing type for the given name when they receive a single + argument (the name of the class or role). This could come up if you had two + attributes both of which required an object of the same type. + +------------------------------------------------------------------- +Sat Oct 8 13:44:33 UTC 2016 - coolo@suse.com + +- initial package 0.24 + * created by cpanspec 1.78.08 + diff --git a/perl-Specio.spec b/perl-Specio.spec new file mode 100644 index 0000000..c10bc17 --- /dev/null +++ b/perl-Specio.spec @@ -0,0 +1,142 @@ +# +# spec file for package perl-Specio +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define cpan_name Specio +Name: perl-Specio +Version: 0.490.0 +Release: 0 +# 0.49 -> normalize -> 0.490.0 +%define cpan_version 0.49 +License: Artistic-2.0 +Summary: Type constraints and coercions for Perl +URL: https://metacpan.org/release/%{cpan_name} +Source0: https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/%{cpan_name}-%{cpan_version}.tar.gz +Source1: cpanspec.yml +BuildArch: noarch +BuildRequires: perl +BuildRequires: perl-macros +BuildRequires: perl(Clone) +BuildRequires: perl(Devel::StackTrace) +BuildRequires: perl(Eval::Closure) +BuildRequires: perl(List::Util) >= 1.33 +BuildRequires: perl(MRO::Compat) +BuildRequires: perl(Module::Runtime) +BuildRequires: perl(Role::Tiny) >= 1.003003 +BuildRequires: perl(Role::Tiny::With) +BuildRequires: perl(Sub::Quote) +BuildRequires: perl(Test::Fatal) +BuildRequires: perl(Test::More) >= 0.96 +BuildRequires: perl(Test::Needs) +BuildRequires: perl(Try::Tiny) +BuildRequires: perl(XString) +BuildRequires: perl(parent) +BuildRequires: perl(version) >= 0.83 +Requires: perl(Clone) +Requires: perl(Devel::StackTrace) +Requires: perl(Eval::Closure) +Requires: perl(List::Util) >= 1.33 +Requires: perl(MRO::Compat) +Requires: perl(Module::Runtime) +Requires: perl(Role::Tiny) >= 1.003003 +Requires: perl(Role::Tiny::With) +Requires: perl(Sub::Quote) +Requires: perl(Test::Fatal) +Requires: perl(Test::More) >= 0.96 +Requires: perl(Try::Tiny) +Requires: perl(XString) +Requires: perl(parent) +Requires: perl(version) >= 0.83 +Provides: perl(Specio) = %{version} +Provides: perl(Specio::Coercion) = %{version} +Provides: perl(Specio::Constraint::AnyCan) = %{version} +Provides: perl(Specio::Constraint::AnyDoes) = %{version} +Provides: perl(Specio::Constraint::AnyIsa) = %{version} +Provides: perl(Specio::Constraint::Enum) = %{version} +Provides: perl(Specio::Constraint::Intersection) = %{version} +Provides: perl(Specio::Constraint::ObjectCan) = %{version} +Provides: perl(Specio::Constraint::ObjectDoes) = %{version} +Provides: perl(Specio::Constraint::ObjectIsa) = %{version} +Provides: perl(Specio::Constraint::Parameterizable) = %{version} +Provides: perl(Specio::Constraint::Parameterized) = %{version} +Provides: perl(Specio::Constraint::Role::CanType) = %{version} +Provides: perl(Specio::Constraint::Role::DoesType) = %{version} +Provides: perl(Specio::Constraint::Role::Interface) = %{version} +Provides: perl(Specio::Constraint::Role::IsaType) = %{version} +Provides: perl(Specio::Constraint::Simple) = %{version} +Provides: perl(Specio::Constraint::Structurable) = %{version} +Provides: perl(Specio::Constraint::Structured) = %{version} +Provides: perl(Specio::Constraint::Union) = %{version} +Provides: perl(Specio::Declare) = %{version} +Provides: perl(Specio::DeclaredAt) = %{version} +Provides: perl(Specio::Exception) = %{version} +Provides: perl(Specio::Exporter) = %{version} +Provides: perl(Specio::Helpers) = %{version} +Provides: perl(Specio::Library::Builtins) = %{version} +Provides: perl(Specio::Library::Numeric) = %{version} +Provides: perl(Specio::Library::Perl) = %{version} +Provides: perl(Specio::Library::String) = %{version} +Provides: perl(Specio::Library::Structured) = %{version} +Provides: perl(Specio::Library::Structured::Dict) = %{version} +Provides: perl(Specio::Library::Structured::Map) = %{version} +Provides: perl(Specio::Library::Structured::Tuple) = %{version} +Provides: perl(Specio::OO) = %{version} +Provides: perl(Specio::PartialDump) = %{version} +Provides: perl(Specio::Registry) = %{version} +Provides: perl(Specio::Role::Inlinable) = %{version} +Provides: perl(Specio::Subs) = %{version} +Provides: perl(Specio::TypeChecks) = %{version} +Provides: perl(Test::Specio) = %{version} +%undefine __perllib_provides +Recommends: perl(Ref::Util) >= 0.112 +Recommends: perl(Sub::Util) >= 1.40 +%{perl_requires} + +%description +The 'Specio' distribution provides classes for representing type +constraints and coercion, along with syntax sugar for declaring them. + +Note that this is not a proper type system for Perl. Nothing in this +distribution will magically make the Perl interpreter start checking a +value's type on assignment to a variable. In fact, there's no built-in way +to apply a type to a variable at all. + +Instead, you can explicitly check a value against a type, and optionally +coerce values to that type. + +%prep +%autosetup -n %{cpan_name}-%{cpan_version} + +find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644 + +%build +perl Makefile.PL INSTALLDIRS=vendor +%make_build + +%check +make test + +%install +%perl_make_install +%perl_process_packlist +%perl_gen_filelist + +%files -f %{name}.files +%doc Changes CODE_OF_CONDUCT.md CONTRIBUTING.md README.md TODO.md +%license LICENSE + +%changelog