Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove __version__ #284

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Changelog
=========

0.16.0 (unreleased)
*******************
1.0.0 (unreleased)
******************

Features:

Expand All @@ -18,6 +18,12 @@ Support:
* Test against Python 3.12.
* Drop support for Python 3.7.

Other changes:

* *Backwards-incompatible*: Remove ```flask_marshmallow.__version__``
and ``flask_marshmallow.__version_info__`` attributes (:pr:`284`).
Use feature detection or ``importlib.metadata.version("flask-marshmallow")`` instead.

0.15.0 (2023-04-05)
*******************

Expand Down
21 changes: 1 addition & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

from setuptools import find_packages, setup

EXTRAS_REQUIRE = {
Expand All @@ -15,23 +13,6 @@
REQUIRES = ["Flask", "marshmallow>=3.0.0", "packaging>=17.0"]


def find_version(fname):
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
"""
version = ""
with open(fname) as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)
if m:
version = m.group(1)
break
if not version:
raise RuntimeError("Cannot find version information")
return version


def read(fname):
with open(fname) as fp:
content = fp.read()
Expand All @@ -40,7 +21,7 @@ def read(fname):

setup(
name="flask-marshmallow",
version=find_version("src/flask_marshmallow/__init__.py"),
version="1.0.0",
description="Flask + marshmallow for beautiful APIs",
long_description=read("README.rst"),
author="Steven Loria",
Expand Down
4 changes: 0 additions & 4 deletions src/flask_marshmallow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
with your Flask application.
"""
import warnings
from packaging.version import Version

from marshmallow import fields as base_fields, exceptions, pprint

Expand All @@ -30,16 +29,13 @@
else:
has_sqla = True

__version__ = "0.15.0"
__version_info__ = Version(__version__).release
__all__ = [
"EXTENSION_NAME",
"Marshmallow",
"Schema",
"fields",
"exceptions",
"pprint",
"validate",
]

EXTENSION_NAME = "flask-marshmallow"
Expand Down