Skip to content

Commit 8b62b1f

Browse files
authored
Merge pull request #2718 from bagerard/prepare_release_0_25_0
improvements for 0 25 0
2 parents de94fd1 + 450e0f2 commit 8b62b1f

File tree

5 files changed

+42
-15
lines changed

5 files changed

+42
-15
lines changed

.github/workflows/github-actions.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ jobs:
111111
cd docs
112112
make html-readthedocs
113113
114-
build-n-publish-dummy:
114+
build-dryrun:
115115
runs-on: ubuntu-latest
116116
needs: [linting, test, build_doc_dryrun]
117-
if: github.event_name != 'pull_request'
118117
steps:
119118
- uses: actions/checkout@master
120119
- uses: actions/setup-python@v4
@@ -124,19 +123,11 @@ jobs:
124123
- name: build dummy wheel for test-pypi
125124
run: |
126125
pip install wheel
127-
python setup.py egg_info -b ".dev`date '+%Y%m%d%H%M%S'`" build sdist bdist_wheel
128-
# - name: publish test-pypi
129-
# # Although working and recommended, test-pypi has a limit
130-
# # in the size of projects so it's better to avoid publishing
131-
# # until there is a way to garbage collect these dummy releases
132-
# uses: pypa/gh-action-pypi-publish@master
133-
# with:
134-
# password: ${{ secrets.test_pypi_token }}
135-
# repository_url: https://test.pypi.org/legacy/
126+
python setup.py sdist bdist_wheel
136127
137128
build-n-publish:
138129
runs-on: ubuntu-latest
139-
needs: [linting, test, build_doc_dryrun, build-n-publish-dummy]
130+
needs: [linting, test, build_doc_dryrun, build-dryrun]
140131
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
141132
steps:
142133
- uses: actions/checkout@master

docs/changelog.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ Changelog
77
Development
88
===========
99
- (Fill this out as you fix issues and develop your features).
10+
11+
Changes in 0.25.0
12+
=================
1013
- Support MONGODB-AWS authentication mechanism (with `authmechanismproperties`) #2507
1114
- Turning off dereferencing for the results of distinct query. #2663
1215
- Add tests against Mongo 5.0 in pipeline
1316
- Drop support for Python 3.6 (EOL)
14-
- Bug fix support for PyMongo>=4 to fix "InvalidOperation: Cannot use MongoClient after close"
15-
errors.
17+
- Bug fix support for PyMongo>=4 to fix "pymongo.errors.InvalidOperation: Cannot use MongoClient after close"
18+
errors. #2627
1619

1720
Changes in 0.24.2
1821
=================

mongoengine/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
)
3030

3131

32-
VERSION = (0, 24, 2)
32+
VERSION = (0, 25, 0)
3333

3434

3535
def get_version():

tests/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
3+
_THIS_MODULE = os.path.abspath(__file__)
4+
TESTS_DIR = os.path.dirname(_THIS_MODULE)
5+
6+
ROOT_DIR = os.path.dirname(TESTS_DIR)
7+
DOCS_DIR = os.path.join(ROOT_DIR, "docs")

tests/test_changelog_consistency.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
from pathlib import Path
3+
4+
from mongoengine import get_version
5+
from tests import DOCS_DIR
6+
7+
8+
def test_package_version_described_in_changelog():
9+
"""Ensures that changelog is updated when version is incremented"""
10+
version_str = get_version()
11+
changelog_content = Path(os.path.join(DOCS_DIR, "changelog.rst")).read_text()
12+
assert (
13+
version_str in changelog_content
14+
), "Version in __init__.py not present in changelog"
15+
16+
17+
def test_package_version_incremented_when_new_version_added_to_changelog():
18+
"""Ensures that changelog is updated when version is incremented"""
19+
version_str = get_version()
20+
changelog_content = Path(os.path.join(DOCS_DIR, "changelog.rst")).read_text()
21+
22+
def find_between(s, start, end):
23+
return (s.split(start))[1].split(end)[0]
24+
25+
most_recent_version = find_between(changelog_content, start="Changes in ", end="\n")
26+
assert most_recent_version == version_str

0 commit comments

Comments
 (0)