Skip to content

Commit 3625838

Browse files
committed
fix LICENSE.jinja
1 parent 8147766 commit 3625838

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

extensions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
import subprocess
3+
from datetime import date
34

45
from jinja2.ext import Extension
56

@@ -77,3 +78,9 @@ def _py_classifiers(self, min_version: str, max_version: str) -> list[str]:
7778
def _black_target_versions(self, min_version: str, max_version: str) -> list[str]:
7879
versions = self._py_versions_range(min_version, max_version)
7980
return [f"py{version.replace('.', '')}" for version in versions]
81+
82+
83+
class CurrentYearExtension(Extension):
84+
def __init__(self, environment):
85+
super().__init__(environment)
86+
environment.globals["current_year"] = date.today().year

template/LICENSE.jinja

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
576576
{% elif copyright_license == 'BSD-2-Clause' -%}
577577
BSD 2-Clause License
578578

579-
Copyright (c) {{ copyright_date }}, {{ copyright_holder }}
579+
Copyright (c) {{ current_year }}, {{ author_name }}
580580
All rights reserved.
581581

582582
Redistribution and use in source and binary forms, with or without
@@ -602,7 +602,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
602602
{% elif copyright_license == 'BSD-3-Clause-Clear' -%}
603603
The Clear BSD License
604604

605-
Copyright (c) {{ copyright_date }} {{ copyright_holder }}
605+
Copyright (c) {{ current_year }} {{ author_name }}
606606
All rights reserved.
607607

608608
Redistribution and use in source and binary forms, with or without
@@ -635,7 +635,7 @@ POSSIBILITY OF SUCH DAMAGE.
635635
{% elif copyright_license == 'BSD-3-Clause' -%}
636636
BSD 3-Clause License
637637

638-
Copyright (c) {{ copyright_date }}, {{ copyright_holder }}
638+
Copyright (c) {{ current_year }}, {{ author_name }}
639639
All rights reserved.
640640

641641
Redistribution and use in source and binary forms, with or without
@@ -5266,7 +5266,7 @@ Library.
52665266
{% elif copyright_license == 'ISC' -%}
52675267
ISC License
52685268

5269-
Copyright (c) {{ copyright_date }}, {{ copyright_holder }}
5269+
Copyright (c) {{ current_year }}, {{ author_name }}
52705270

52715271
Permission to use, copy, modify, and/or distribute this software for any
52725272
purpose with or without fee is hereby granted, provided that the above
@@ -5698,7 +5698,7 @@ Important Recommendations
56985698
{% elif copyright_license == 'MIT' -%}
56995699
MIT License
57005700

5701-
Copyright (c) {{ copyright_date }} {{ copyright_holder }}
5701+
Copyright (c) {{ current_year }} {{ author_name }}
57025702

57035703
Permission is hereby granted, free of charge, to any person obtaining a copy
57045704
of this software and associated documentation files (the "Software"), to deal
@@ -6212,10 +6212,10 @@ contribution.
62126212
{% elif copyright_license == 'NCSA' -%}
62136213
University of Illinois/NCSA Open Source License
62146214

6215-
Copyright (c) {{ copyright_date }} {{ copyright_holder }}. All rights reserved.
6215+
Copyright (c) {{ current_year }} {{ author_name }}. All rights reserved.
62166216

62176217
Developed by: [project]
6218-
{{ copyright_holder }}
6218+
{{ author_name }}
62196219
[projecturl]
62206220

62216221
Permission is hereby granted, free of charge, to any person
@@ -6233,7 +6233,7 @@ subject to the following conditions:
62336233
notice, this list of conditions and the following disclaimers in the
62346234
documentation and/or other materials provided with the distribution.
62356235

6236-
* Neither the names of {{ copyright_holder }}, [project] nor the names of its
6236+
* Neither the names of {{ author_name }}, [project] nor the names of its
62376237
contributors may be used to endorse or promote products derived from
62386238
this Software without specific prior written permission.
62396239

@@ -6245,7 +6245,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62456245
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
62466246
THE SOFTWARE.
62476247
{% elif copyright_license == 'OFL-1.1' -%}
6248-
Copyright (c) {{ copyright_date }} {{ copyright_holder }} ({{ copyright_holder_email }})
6248+
Copyright (c) {{ current_year }} {{ author_name }} ({{ copyright_holder_email }})
62496249

62506250
This Font Software is licensed under the SIL Open Font License, Version 1.1.
62516251
This license is copied below, and is also available with a FAQ at:
@@ -6513,22 +6513,22 @@ comply with its license review and certification process.
65136513
{% elif copyright_license == 'PostgreSQL' -%}
65146514
PostgreSQL Licence
65156515

6516-
Copyright (c) {{ copyright_date }}, {{ copyright_holder }}
6516+
Copyright (c) {{ current_year }}, {{ author_name }}
65176517

65186518
Permission to use, copy, modify, and distribute this software and its
65196519
documentation for any purpose, without fee, and without a written agreement is
65206520
hereby granted, provided that the above copyright notice and this paragraph
65216521
and the following two paragraphs appear in all copies.
65226522

6523-
IN NO EVENT SHALL {{ copyright_holder }} BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
6523+
IN NO EVENT SHALL {{ author_name }} BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
65246524
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
6525-
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF {{ copyright_holder }}
6525+
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF {{ author_name }}
65266526
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65276527

6528-
{{ copyright_holder }} SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
6528+
{{ author_name }} SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
65296529
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
65306530
PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
6531-
AND {{ copyright_holder }} HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
6531+
AND {{ author_name }} HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
65326532
ENHANCEMENTS, OR MODIFICATIONS.
65336533
{% elif copyright_license == 'Unlicense' -%}
65346534
This is free and unencumbered software released into the public domain.
@@ -6558,7 +6558,7 @@ For more information, please refer to <http://unlicense.org>
65586558
{% elif copyright_license == 'Zlib' -%}
65596559
zlib License
65606560

6561-
(C) {{ copyright_date }} {{ copyright_holder }}
6561+
(C) {{ current_year }} {{ author_name }}
65626562

65636563
This software is provided 'as-is', without any express or implied
65646564
warranty. In no event will the authors be held liable for any damages

0 commit comments

Comments
 (0)