2018-09-05 17:10:05 -04:00
|
|
|
#!/bin/bash -xe
|
|
|
|
|
# Release packages to PyPI
|
|
|
|
|
|
|
|
|
|
if [ "$RELEASE_DIR" = "" ]; then
|
|
|
|
|
echo Please run this script through the tools/release.sh wrapper script or set the environment
|
|
|
|
|
echo variable RELEASE_DIR to the directory where the release should be built.
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2020-01-21 18:53:31 -05:00
|
|
|
ExitWarning() {
|
|
|
|
|
exit_status="$?"
|
|
|
|
|
if [ "$exit_status" != 0 ]; then
|
|
|
|
|
# Don't print each command before executing it because it will disrupt
|
|
|
|
|
# the desired output.
|
|
|
|
|
set +x
|
|
|
|
|
echo '******************************'
|
|
|
|
|
echo '* *'
|
|
|
|
|
echo '* THE RELEASE SCRIPT FAILED! *'
|
|
|
|
|
echo '* *'
|
|
|
|
|
echo '******************************'
|
|
|
|
|
set -x
|
|
|
|
|
fi
|
|
|
|
|
exit "$exit_status"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trap ExitWarning EXIT
|
|
|
|
|
|
2018-09-05 17:10:05 -04:00
|
|
|
version="$1"
|
|
|
|
|
echo Releasing production version "$version"...
|
|
|
|
|
nextversion="$2"
|
|
|
|
|
RELEASE_BRANCH="candidate-$version"
|
|
|
|
|
|
2021-10-14 17:27:15 -04:00
|
|
|
# If RELEASE_GPG_KEY isn't set, determine the key to use.
|
|
|
|
|
if [ "$RELEASE_GPG_KEY" = "" ]; then
|
|
|
|
|
TRUSTED_KEYS="
|
|
|
|
|
BF6BCFC89E90747B9A680FD7B6029E8500F7DB16
|
|
|
|
|
86379B4F0AF371B50CD9E5FF3402831161D1D280
|
|
|
|
|
20F201346BF8F3F455A73F9A780CC99432A28621
|
|
|
|
|
"
|
|
|
|
|
for key in $TRUSTED_KEYS; do
|
|
|
|
|
if gpg2 --with-colons --card-status | grep -q "$key"; then
|
|
|
|
|
RELEASE_GPG_KEY="$key"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ "$RELEASE_GPG_KEY" = "" ]; then
|
|
|
|
|
echo A trusted PGP key was not found on your PGP card.
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2018-09-05 17:10:05 -04:00
|
|
|
# Needed to fix problems with git signatures and pinentry
|
|
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
|
|
|
|
|
|
# port for a local Python Package Index (used in testing)
|
|
|
|
|
PORT=${PORT:-1234}
|
|
|
|
|
|
|
|
|
|
# subpackages to be released (the way the script thinks about them)
|
2021-04-22 16:37:46 -04:00
|
|
|
SUBPKGS_NO_CERTBOT="acme certbot-apache certbot-nginx certbot-dns-cloudflare certbot-dns-cloudxns \
|
|
|
|
|
certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy \
|
|
|
|
|
certbot-dns-gehirn certbot-dns-google certbot-dns-linode certbot-dns-luadns \
|
|
|
|
|
certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 \
|
|
|
|
|
certbot-dns-sakuracloud"
|
|
|
|
|
SUBPKGS="certbot $SUBPKGS_NO_CERTBOT"
|
2018-09-05 17:10:05 -04:00
|
|
|
# certbot_compatibility_test is not packaged because:
|
|
|
|
|
# - it is not meant to be used by anyone else than Certbot devs
|
|
|
|
|
# - it causes problems when running pytest - the latter tries to
|
|
|
|
|
# run everything that matches test*, while there are no unittests
|
|
|
|
|
# there
|
|
|
|
|
|
|
|
|
|
tag="v$version"
|
|
|
|
|
mv "dist.$version" "dist.$version.$(date +%s).bak" || true
|
|
|
|
|
git tag --delete "$tag" || true
|
|
|
|
|
|
|
|
|
|
tmpvenv=$(mktemp -d)
|
2020-04-20 17:44:53 -04:00
|
|
|
python3 -m venv "$tmpvenv"
|
2018-09-05 17:10:05 -04:00
|
|
|
. $tmpvenv/bin/activate
|
|
|
|
|
# update setuptools/pip just like in other places in the repo
|
|
|
|
|
pip install -U setuptools
|
|
|
|
|
pip install -U pip # latest pip => no --pre for dev releases
|
|
|
|
|
pip install -U wheel # setup.py bdist_wheel
|
|
|
|
|
|
|
|
|
|
# newer versions of virtualenv inherit setuptools/pip/wheel versions
|
|
|
|
|
# from current env when creating a child env
|
|
|
|
|
pip install -U virtualenv
|
|
|
|
|
|
|
|
|
|
root_without_le="$version.$$"
|
|
|
|
|
root="$RELEASE_DIR/le.$root_without_le"
|
|
|
|
|
|
|
|
|
|
echo "Cloning into fresh copy at $root" # clean repo = no artifacts
|
|
|
|
|
git clone . $root
|
|
|
|
|
git rev-parse HEAD
|
|
|
|
|
cd $root
|
|
|
|
|
if [ "$RELEASE_BRANCH" != "candidate-$version" ] ; then
|
|
|
|
|
git branch -f "$RELEASE_BRANCH"
|
|
|
|
|
fi
|
|
|
|
|
git checkout "$RELEASE_BRANCH"
|
|
|
|
|
|
2018-11-26 17:48:59 -05:00
|
|
|
# Update changelog
|
2019-11-25 21:24:20 -05:00
|
|
|
sed -i "s/master/$(date +'%Y-%m-%d')/" certbot/CHANGELOG.md
|
|
|
|
|
git add certbot/CHANGELOG.md
|
2018-11-26 17:48:59 -05:00
|
|
|
git commit -m "Update changelog for $version release"
|
|
|
|
|
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
for pkg_dir in $SUBPKGS certbot-compatibility-test
|
2018-09-05 17:10:05 -04:00
|
|
|
do
|
|
|
|
|
sed -i 's/\.dev0//' "$pkg_dir/setup.py"
|
|
|
|
|
git add "$pkg_dir/setup.py"
|
2019-04-05 16:38:37 -04:00
|
|
|
done
|
2018-11-26 17:48:59 -05:00
|
|
|
|
2018-09-05 17:10:05 -04:00
|
|
|
SetVersion() {
|
|
|
|
|
ver="$1"
|
|
|
|
|
# bumping Certbot's version number is done differently
|
|
|
|
|
for pkg_dir in $SUBPKGS_NO_CERTBOT certbot-compatibility-test
|
|
|
|
|
do
|
|
|
|
|
setup_file="$pkg_dir/setup.py"
|
|
|
|
|
if [ $(grep -c '^version' "$setup_file") != 1 ]; then
|
|
|
|
|
echo "Unexpected count of version variables in $setup_file"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
sed -i "s/^version.*/version = '$ver'/" $pkg_dir/setup.py
|
|
|
|
|
done
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
init_file="certbot/certbot/__init__.py"
|
2018-09-05 17:10:05 -04:00
|
|
|
if [ $(grep -c '^__version' "$init_file") != 1 ]; then
|
|
|
|
|
echo "Unexpected count of __version variables in $init_file"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
sed -i "s/^__version.*/__version__ = '$ver'/" "$init_file"
|
|
|
|
|
|
|
|
|
|
git add $SUBPKGS certbot-compatibility-test
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetVersion "$version"
|
|
|
|
|
|
2019-04-30 14:59:05 -04:00
|
|
|
# Unset CERTBOT_OLDEST to prevent wheels from being built improperly due to
|
|
|
|
|
# conditionals like the one found in certbot-dns-dnsimple's setup.py file.
|
|
|
|
|
unset CERTBOT_OLDEST
|
2018-09-05 17:10:05 -04:00
|
|
|
echo "Preparing sdists and wheels"
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
for pkg_dir in $SUBPKGS
|
2018-09-05 17:10:05 -04:00
|
|
|
do
|
|
|
|
|
cd $pkg_dir
|
|
|
|
|
|
|
|
|
|
python setup.py clean
|
|
|
|
|
rm -rf build dist
|
|
|
|
|
python setup.py sdist
|
|
|
|
|
python setup.py bdist_wheel
|
|
|
|
|
|
|
|
|
|
echo "Signing ($pkg_dir)"
|
|
|
|
|
for x in dist/*.tar.gz dist/*.whl
|
|
|
|
|
do
|
|
|
|
|
gpg2 -u "$RELEASE_GPG_KEY" --detach-sign --armor --sign --digest-algo sha256 $x
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cd -
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkdir "dist.$version"
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
for pkg_dir in $SUBPKGS
|
2018-09-05 17:10:05 -04:00
|
|
|
do
|
|
|
|
|
mv $pkg_dir/dist "dist.$version/$pkg_dir/"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "Testing packages"
|
|
|
|
|
cd "dist.$version"
|
|
|
|
|
# start local PyPI
|
2020-04-20 17:44:53 -04:00
|
|
|
python -m http.server $PORT &
|
2018-09-05 17:10:05 -04:00
|
|
|
# cd .. is NOT done on purpose: we make sure that all subpackages are
|
|
|
|
|
# installed from local PyPI rather than current directory (repo root)
|
2020-03-09 16:05:35 -04:00
|
|
|
VIRTUALENV_NO_DOWNLOAD=1 virtualenv ../venv
|
2018-09-05 17:10:05 -04:00
|
|
|
. ../venv/bin/activate
|
|
|
|
|
pip install -U setuptools
|
|
|
|
|
pip install -U pip
|
|
|
|
|
# Now, use our local PyPI. Disable cache so we get the correct KGS even if we
|
|
|
|
|
# (or our dependencies) have conditional dependencies implemented with if
|
|
|
|
|
# statements in setup.py and we have cached wheels lying around that would
|
|
|
|
|
# cause those ifs to not be evaluated.
|
2019-01-02 13:08:08 -05:00
|
|
|
python ../tools/pip_install.py \
|
2018-09-05 17:10:05 -04:00
|
|
|
--no-cache-dir \
|
|
|
|
|
--extra-index-url http://localhost:$PORT \
|
|
|
|
|
$SUBPKGS
|
|
|
|
|
# stop local PyPI
|
|
|
|
|
kill $!
|
|
|
|
|
cd ~-
|
|
|
|
|
|
|
|
|
|
# get a snapshot of the CLI help for the docs
|
|
|
|
|
# We set CERTBOT_DOCS to use dummy values in example user-agent string.
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
CERTBOT_DOCS=1 certbot --help all > certbot/docs/cli-help.txt
|
2018-09-05 17:10:05 -04:00
|
|
|
jws --help > acme/docs/jws-help.txt
|
|
|
|
|
|
|
|
|
|
deactivate
|
|
|
|
|
|
|
|
|
|
|
2021-04-22 16:37:46 -04:00
|
|
|
git add certbot/docs/cli-help.txt
|
2018-09-11 18:44:26 -04:00
|
|
|
while ! git commit --gpg-sign="$RELEASE_GPG_KEY" -m "Release $version"; do
|
|
|
|
|
echo "Unable to sign the release commit using git."
|
|
|
|
|
echo "You may have to configure git to use gpg2 by running:"
|
|
|
|
|
echo 'git config --global gpg.program $(command -v gpg2)'
|
|
|
|
|
read -p "Press enter to try signing again."
|
|
|
|
|
done
|
2018-09-05 17:10:05 -04:00
|
|
|
git tag --local-user "$RELEASE_GPG_KEY" --sign --message "Release $version" "$tag"
|
|
|
|
|
|
2018-11-26 17:48:59 -05:00
|
|
|
# Add master section to CHANGELOG.md
|
2019-11-25 21:24:20 -05:00
|
|
|
header=$(head -n 4 certbot/CHANGELOG.md)
|
2018-11-26 17:48:59 -05:00
|
|
|
body=$(sed s/nextversion/$nextversion/ tools/_changelog_top.txt)
|
2019-11-25 21:24:20 -05:00
|
|
|
footer=$(tail -n +5 certbot/CHANGELOG.md)
|
2018-11-26 17:48:59 -05:00
|
|
|
echo "$header
|
|
|
|
|
|
|
|
|
|
$body
|
|
|
|
|
|
2019-11-25 21:24:20 -05:00
|
|
|
$footer" > certbot/CHANGELOG.md
|
|
|
|
|
git add certbot/CHANGELOG.md
|
|
|
|
|
git commit -m "Add contents to certbot/CHANGELOG.md for next version"
|
2018-11-26 17:48:59 -05:00
|
|
|
|
2018-09-05 17:10:05 -04:00
|
|
|
if [ "$RELEASE_BRANCH" = candidate-"$version" ] ; then
|
|
|
|
|
SetVersion "$nextversion".dev0
|
|
|
|
|
git commit -m "Bump version to $nextversion"
|
|
|
|
|
fi
|