Skip to content

Commit

Permalink
Version bump v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Jan 10, 2024
1 parent ce80650 commit e0f7fee
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 10 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

1.5.0 (unreleased)
------------------


1.4.0 (2023-01-10)
------------------
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

version = "1.4.0"
version = "1.5.0"

with open("README.rst", "r") as fh:
long_description = fh.read()
Expand Down Expand Up @@ -36,7 +36,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
"senaite.lims>=2.5.0",
"senaite.lims>=2.6.0",
],
extras_require={
"test": [
Expand Down
2 changes: 1 addition & 1 deletion src/senaite/patient/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<metadata>
<version>1416</version>
<version>1500</version>
<dependencies>
<dependency>profile-senaite.lims:default</dependency>
</dependencies>
Expand Down
10 changes: 3 additions & 7 deletions src/senaite/patient/upgrade/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="senaite.patient">

<genericsetup:upgradeStep
title="Upgrade to SENAITE PATIENT 1.4.0"
source="1300"
destination="1400"
handler="senaite.patient.upgrade.v01_04_000.upgrade"
profile="senaite.patient:default"/>
<!-- 1.5.0 -->
<include file="v01_05_000.zcml" />

<!-- Include all upgrade steps for 1.4.0 -->
<!-- 1.4.0 -->
<include file="v01_04_000.zcml" />

<genericsetup:upgradeStep
Expand Down
7 changes: 7 additions & 0 deletions src/senaite/patient/upgrade/v01_04_000.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,11 @@
handler="senaite.patient.upgrade.v01_04_000.upgrade_marital_status"
profile="senaite.patient:default"/>

<genericsetup:upgradeStep
title="Upgrade to SENAITE PATIENT 1.4.0"
source="1300"
destination="1400"
handler="senaite.patient.upgrade.v01_04_000.upgrade"
profile="senaite.patient:default"/>

</configure>
48 changes: 48 additions & 0 deletions src/senaite/patient/upgrade/v01_05_000.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
#
# This file is part of SENAITE.PATIENT.
#
# SENAITE.PATIENT is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Copyright 2020-2024 by it's authors.
# Some rights reserved, see README and LICENSE.

from senaite.core.upgrade import upgradestep
from senaite.core.upgrade.utils import UpgradeUtils
from senaite.patient import logger
from senaite.patient.config import PRODUCT_NAME

version = "1.5.0"
profile = "profile-{0}:default".format(PRODUCT_NAME)


@upgradestep(PRODUCT_NAME, version)
def upgrade(tool):
portal = tool.aq_inner.aq_parent
setup = portal.portal_setup # noqa
ut = UpgradeUtils(portal)
ver_from = ut.getInstalledVersion(PRODUCT_NAME)

if ut.isOlderVersion(PRODUCT_NAME, version):
logger.info("Skipping upgrade of {0}: {1} > {2}".format(
PRODUCT_NAME, ver_from, version))
return True

logger.info("Upgrading {0}: {1} -> {2}".format(PRODUCT_NAME, ver_from,
version))

# -------- ADD YOUR STUFF BELOW --------

logger.info("{0} upgraded to version {1}".format(PRODUCT_NAME, version))
return True
12 changes: 12 additions & 0 deletions src/senaite/patient/upgrade/v01_05_000.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup">

<genericsetup:upgradeStep
title="Upgrade to SENAITE.PATIENT 1.5.0"
source="1416"
destination="1500"
handler=".v01_05_000.upgrade"
profile="senaite.patient:default"/>

</configure>

0 comments on commit e0f7fee

Please sign in to comment.