mbarkhau / bumpver

BumpVer: Automatic Versioning
https://github.com/mbarkhau/bumpver
MIT License
199 stars 36 forks source link

Cannot update YYYY in copyright #172

Closed bdepardo closed 2 years ago

bdepardo commented 2 years ago

Hi,

I'm trying to use bumpver to update the version of our software, along with updating the copyright year in some files.

I have the following pyproject.toml configuration file

[build-system]
requires = ['setuptools>=40.8.0', 'wheel']
build-backend = 'setuptools.build_meta:__legacy__'

[tool.bumpver]
current_version = "1.2"
version_pattern = "MAJOR.MINOR[-PYTAGNUM]"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = [
    'current_version = "{version}"',
]
"version" = [
  "{version}"
]
"LICENSE" = [
  "# Copyright (c) 2017-YYYY"
]

I have the following LICENSE file:

################################################################################
# Copyright (c) 2017-2021
# All Rights Reserved
#
# This software is the confidential and proprietary information
# of  ("Confidential Information").
# You shall not disclose such Confidential Information
# and shall use it only in accordance with the terms of
# the license agreement you entered into with UCit.
################################################################################

If I try to run update, the whole line about the copyright disappears, while the other versions are correctly updated:

bumpver update -n -d  --major
INFO    - Old Version: 1.2
INFO    - New Version: 2.0
--- LICENSE
+++ LICENSE
@@ -1,5 +1,5 @@
 ################################################################################
-# Copyright (c) 2017-2021
+
 # All Rights Reserved
 #
 # This software is the confidential and proprietary information
--- pyproject.toml
+++ pyproject.toml
@@ -4,7 +4,7 @@
 [tool.bumpver]
-current_version = "1.2"
+current_version = "2.0"
 version_pattern = "MAJOR.MINOR[-PYTAGNUM]"
 commit_message = "bump version {old_version} -> {new_version}"
 commit = true
--- version
+++ version
@@ -1,2 +1,2 @@
-1.2
+2.0

What am I doing wrong? Is it possible to update both the software version and the copyright year with a single configuration?

Thanks

mbarkhau commented 2 years ago

You may well have found an issue here, I'm not sure. I never ran across it since most of my projects have the year as part of the version number. The issue may be, that there is no reference point to start with based on which you could detect the rollover. But I don't see why you would need that. I think it should be possible in principle but I'd have to debug.

mbarkhau commented 2 years ago

Fixed with 2022.1115

bdepardo commented 2 years ago

Thanks. Upgraded to 2022.1115 solved the problem, I was in 2021.1114