diff --git a/client/pyproject.toml b/client/pyproject.toml index 662c80d70c..1648912cd6 100644 --- a/client/pyproject.toml +++ b/client/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "securedrop-client" -version = "0.1.0" +version = "0.0.0" description = "SecureDrop Workstation client application" authors = ["SecureDrop Team"] license = "AGPLv3+" diff --git a/client/securedrop_client/gui/auth/dialog.py b/client/securedrop_client/gui/auth/dialog.py index 52d1943420..9b6c14cd9e 100644 --- a/client/securedrop_client/gui/auth/dialog.py +++ b/client/securedrop_client/gui/auth/dialog.py @@ -33,7 +33,7 @@ QWidget, ) -from securedrop_client import __version__ as sd_version +from securedrop_client import __version__ from securedrop_client.gui.auth.sign_in import LoginErrorBar, SignInButton from securedrop_client.gui.auth.use_offline import LoginOfflineLink from securedrop_client.gui.base import PasswordEdit @@ -127,7 +127,7 @@ def __init__(self, parent: QWidget) -> None: form_layout.addWidget(buttons) # Create widget to display application name and version - application_version = QLabel(_("SecureDrop Client v{}").format(sd_version)) + application_version = QLabel(_("SecureDrop Client v{}").format(__version__)) application_version.setAlignment(Qt.AlignHCenter) application_version.setObjectName("LoginDialog_app_version_label") diff --git a/client/setup.py b/client/setup.py index 511793a58f..f484b4164a 100644 --- a/client/setup.py +++ b/client/setup.py @@ -14,7 +14,7 @@ setuptools.setup( name="securedrop-client", - version="0.9.0", + version="0.0.0", author="Freedom of the Press Foundation", author_email="securedrop@freedom.press", description="SecureDrop Workstation client application", diff --git a/client/update_version.sh b/client/update_version.sh deleted file mode 100755 index 11fbb42204..0000000000 --- a/client/update_version.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -## Usage: ./update_version.sh - -set -e - -readonly NEW_VERSION=$1 - -if [ -z "$NEW_VERSION" ]; then - echo "You must specify the new version!" - exit 1 -fi - -# Get the old version from securedrop_client/__init__.py -old_version_regex='^__version__ = "(.*)"$' -[[ "$(cat securedrop_client/__init__.py)" =~ $old_version_regex ]] -OLD_VERSION=${BASH_REMATCH[1]} - -if [ -z "$OLD_VERSION" ]; then - echo "Couldn't find the old version: does this script need to be updated?" - exit 1 -fi - -# Update the version in securedrop_client/__init__.py and setup.py -if [[ "$OSTYPE" == "darwin"* ]]; then - # The empty '' after sed -i is required on macOS to indicate no backup file should be saved. - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_client/__init__.py - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" setup.py -else - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_client/__init__.py - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" setup.py -fi diff --git a/export/MANIFEST.in b/export/MANIFEST.in index 87fb2b1273..14848c3477 100644 --- a/export/MANIFEST.in +++ b/export/MANIFEST.in @@ -1,6 +1,5 @@ include LICENSE include README.md -include securedrop_export/VERSION include changelog.md include build-requirements.txt include securedrop_export/*.py diff --git a/export/pyproject.toml b/export/pyproject.toml index 3afb5b8ba7..26605b1270 100644 --- a/export/pyproject.toml +++ b/export/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "securedrop-export" -version = "0.1.0" +version = "0.0.0" description = "SecureDrop Qubes export scripts" authors = ["SecureDrop Team"] license = "GPLv3+" diff --git a/export/securedrop_export/VERSION b/export/securedrop_export/VERSION deleted file mode 100644 index 0d91a54c7d..0000000000 --- a/export/securedrop_export/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.3.0 diff --git a/export/securedrop_export/__init__.py b/export/securedrop_export/__init__.py index 493f7415d7..3e2f46a3a3 100644 --- a/export/securedrop_export/__init__.py +++ b/export/securedrop_export/__init__.py @@ -1 +1 @@ -__version__ = "0.3.0" +__version__ = "0.9.0" diff --git a/export/setup.py b/export/setup.py index 19256c2e65..c2e5cbebd5 100644 --- a/export/setup.py +++ b/export/setup.py @@ -3,12 +3,9 @@ with open("README.md", "r") as fh: long_description = fh.read() -with open("securedrop_export/VERSION") as f: - version = f.read().strip() - setuptools.setup( name="securedrop-export", - version=version, + version="0.0.0", author="Freedom of the Press Foundation", author_email="securedrop@freedom.press", description="SecureDrop Qubes export scripts", @@ -19,9 +16,6 @@ python_requires=">=3.5", url="https://github.com/freedomofpress/securedrop-export", packages=setuptools.find_packages(exclude=["docs", "tests"]), - package_data={ - "securedrop_export": ["VERSION"], - }, classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", diff --git a/export/update_version.sh b/export/update_version.sh deleted file mode 100755 index f66ee435d1..0000000000 --- a/export/update_version.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -## Usage: ./update_version.sh - -set -e - -readonly NEW_VERSION=$1 - -if [ -z "$NEW_VERSION" ]; then - echo "You must specify the new version!" - exit 1 -fi - -# Get the old version from securedrop_export/VERSION -OLD_VERSION=$(cat securedrop_export/VERSION) -if [ -z "$OLD_VERSION" ]; then - echo "Couldn't find the old version: does this script need to be updated?" - exit 1 -fi - -# Update the version in securedrop_export/VERSION (setup.py is done automatically) -if [[ "$OSTYPE" == "darwin"* ]]; then - # The empty '' after sed -i is required on macOS to indicate no backup file should be saved. - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_export/VERSION - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_export/__init__.py -else - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_export/VERSION - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_export/__init__.py -fi diff --git a/log/MANIFEST.in b/log/MANIFEST.in index b1e9a7fa95..bba9999d8c 100644 --- a/log/MANIFEST.in +++ b/log/MANIFEST.in @@ -7,4 +7,3 @@ include securedrop-redis-log include securedrop.Log include sd-rsyslog* include sdlog.conf -include VERSION diff --git a/log/VERSION b/log/VERSION deleted file mode 100644 index 0ea3a944b3..0000000000 --- a/log/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.2.0 diff --git a/log/pyproject.toml b/log/pyproject.toml index cbca5340e0..1faef531fb 100644 --- a/log/pyproject.toml +++ b/log/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "securedrop-log" -version = "0.1.0" +version = "0.0.0" description = "SecureDrop Qubes logging scripts" authors = ["SecureDrop Team"] license = "GPLv3+" diff --git a/log/setup.py b/log/setup.py index 520bac2c6a..c697f47c2e 100644 --- a/log/setup.py +++ b/log/setup.py @@ -3,13 +3,9 @@ with open("README.md", "r") as fh: long_description = fh.read() -with open("VERSION") as fh: - version = fh.read().strip() - - setuptools.setup( name="securedrop-log", - version=version, + version="0.0.0", author="Freedom of the Press Foundation", author_email="securedrop@freedom.press", description="SecureDrop Qubes logging scripts", @@ -19,9 +15,6 @@ install_requires=[], python_requires=">=3.5", packages=setuptools.find_packages(exclude=["docs", "tests"]), - package_data={ - 'securedrop_log': ['VERSION'], - }, url="https://github.com/freedomofpress/securedrop-log", classifiers=[ "Development Status :: 3 - Alpha", diff --git a/log/update_version.sh b/log/update_version.sh deleted file mode 100755 index 3bd6903ce3..0000000000 --- a/log/update_version.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -## Usage: ./update_version.sh - -set -e - -readonly NEW_VERSION=$1 - -if [ -z "$NEW_VERSION" ]; then - echo "You must specify the new version!" - exit 1 -fi - -# Get the old version from VERSION -OLD_VERSION=$(cat VERSION) -if [ -z "$OLD_VERSION" ]; then - echo "Couldn't find the old version: does this script need to be updated?" - exit 1 -fi - -# Update the version in VERSION (setup.py is done automatically) -if [[ "$OSTYPE" == "darwin"* ]]; then - # The empty '' after sed -i is required on macOS to indicate no backup file should be saved. - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" VERSION -else - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" VERSION -fi diff --git a/proxy/MANIFEST.in b/proxy/MANIFEST.in index adb7bc8041..4686841ae5 100644 --- a/proxy/MANIFEST.in +++ b/proxy/MANIFEST.in @@ -1,6 +1,5 @@ include LICENSE include README.md -include securedrop_proxy/VERSION include changelog.md include config-example.yaml include qubes/securedrop.Proxy diff --git a/proxy/securedrop_proxy/VERSION b/proxy/securedrop_proxy/VERSION deleted file mode 100644 index 267577d47e..0000000000 --- a/proxy/securedrop_proxy/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.4.1 diff --git a/proxy/securedrop_proxy/version.py b/proxy/securedrop_proxy/version.py index 0ebdbd2462..57fde319e8 100644 --- a/proxy/securedrop_proxy/version.py +++ b/proxy/securedrop_proxy/version.py @@ -1,8 +1 @@ -import pkgutil - -version = None -version_content = pkgutil.get_data("securedrop_proxy", "VERSION") -if isinstance(version_content, bytes): - version = version_content.decode("utf-8") -else: - raise ValueError("Could not read VERSION file") +version = "0.4.1\n" diff --git a/proxy/setup.py b/proxy/setup.py index 5aa3dfd362..c4ffc1db15 100644 --- a/proxy/setup.py +++ b/proxy/setup.py @@ -4,12 +4,9 @@ with open("README.md", "r") as fh: long_description = fh.read() -version = pkgutil.get_data("securedrop_proxy", "VERSION").decode("utf-8") -version = version.strip() - setuptools.setup( name="securedrop-proxy", - version=version, + version="0.0.0", author="Freedom of the Press Foundation", author_email="securedrop@freedom.press", description="SecureDrop Qubes proxy service", @@ -20,9 +17,6 @@ python_requires=">=3.7", url="https://github.com/freedomofpress/securedrop-proxy", packages=setuptools.find_packages(exclude=["docs", "tests"]), - package_data={ - 'securedrop_proxy': ['VERSION'], - }, classifiers=( "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", diff --git a/proxy/update_version.sh b/proxy/update_version.sh deleted file mode 100755 index 7e027d2021..0000000000 --- a/proxy/update_version.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -## Usage: ./update_version.sh - -set -e - -readonly NEW_VERSION=$1 - -if [ -z "$NEW_VERSION" ]; then - echo "You must specify the new version!" - exit 1 -fi - -# Get the old version from securedrop_proxy/VERSION -OLD_VERSION=$(cat securedrop_proxy/VERSION) - -if [ -z "$OLD_VERSION" ]; then - echo "Couldn't find the old version: does this script need to be updated?" - exit 1 -fi - -# Update the version in securedrop_proxy/VERSION -if [[ "$OSTYPE" == "darwin"* ]]; then - # The empty '' after sed -i is required on macOS to indicate no backup file should be saved. - sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_proxy/VERSION -else - sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_proxy/VERSION -fi diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 0000000000..53248f398a --- /dev/null +++ b/update_version.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -euxo pipefail + +NEW_VERSION=${1:-""} + +if [ -z "$NEW_VERSION" ]; then + echo "Usage: ./update_version.sh "; + exit 1 +fi + + +if [[ $NEW_VERSION == *~rc* ]]; then + echo "RCs should use the versioning a.b.c-rcD, where a.b.c is the next version" + exit 1 +fi + +sed -i'' -r -e "s/^__version__ = \"(.*?)\"/__version__ = \"${NEW_VERSION}\"/" client/securedrop_client/__init__.py +sed -i'' -r -e "s/^__version__ = \"(.*?)\"/__version__ = \"${NEW_VERSION}\"/" export/securedrop_export/__init__.py + +# Normalize version, convert any - to ~, e.g. 0.9.0-rc1 to 0.9.0~rc1 +DEB_VERSION=$(echo $NEW_VERSION | sed 's/-/~/g') + +export DEBEMAIL="securedrop@freedom.press" +export DEBFULLNAME="SecureDrop Team" +dch -b --newversion "${DEB_VERSION}" --distribution unstable "see changelog.md"