Skip to content

Commit

Permalink
move version number to setup.py
Browse files Browse the repository at this point in the history
releasing 0.1.1
  • Loading branch information
dArignac authored and justinmayer committed Jul 31, 2023
1 parent 76d2ca6 commit b4a6e6d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
3 changes: 0 additions & 3 deletions minification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from pelican import signals


__version__ = '0.1.1'


class Minification(object):
"""
Class that does file content minification.
Expand Down
18 changes: 1 addition & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python
import codecs
import os
import re

from setuptools import setup

Expand All @@ -10,24 +8,10 @@
long_description = f.read()


def get_version():
"""
Returns the version of the package from the __init__ file.
:return: version number
:rtype: str
"""
with codecs.open(os.path.join(os.path.dirname(__file__), 'minification', '__init__.py'), encoding='utf-8') as f:
version_file = f.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to fetch version')


setup(
name='pelican-minification',
description='Minifies HTML, CSS and JS of generated Pelican content.',
version=get_version(),
version='0.1.1',
author='Alexander Herrmann',
author_email='[email protected]',
license='MIT',
Expand Down

0 comments on commit b4a6e6d

Please sign in to comment.