Skip to content

Commit

Permalink
Merge pull request #9 from shanosborne/implement-versioning
Browse files Browse the repository at this point in the history
Add versioning to README
  • Loading branch information
shanosborne authored Jan 23, 2020
2 parents 7cca968 + 8dcb20d commit 54492cf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ To get the data from the step by step calculations for the FGS countrate and mag
fgs.band_dataframe
```

Versioning
----------
This repository follows the principles of ["Semantic Versioning"](https://semver.org/), such that

> Given a version number MAJOR.MINOR.PATCH, increment the:
> 1. MAJOR version when you make incompatible API changes,
> 2. MINOR version when you add functionality in a backwards compatible manner, and
> 3. PATCH version when you make backwards compatible bug fixes.
When releasing a new version, developers should change the version number in `setup.py`, merge this change in a PR, and then release the package via the GitHub interface.

License
-------

Expand Down
23 changes: 17 additions & 6 deletions fgscountrate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,28 @@
from ._astropy_init import *
# ----------------------------------------------------------------------------

import os
import sys
from pkg_resources import get_distribution, DistributionNotFound
import pkg_resources

module_path = pkg_resources.resource_filename('fgscountrate', '')
setup_path = os.path.normpath(os.path.join(module_path, '../setup.py'))

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = "unknown"
with open(setup_path) as f:
data = f.readlines()

for line in data:
if 'VERSION =' in line:
__version__ = line.split(' ')[-1].replace("'", "").strip()

except FileNotFoundError:
print('Could not determine fgscountrate version')
__version__ = '0.0.0'

__minimum_python_version__ = "3.5"


class UnsupportedPythonError(Exception):
pass

Expand All @@ -25,4 +36,4 @@ class UnsupportedPythonError(Exception):

from .fgs_countrate_core import *
from .utils import *
from .conversions import *
from .conversions import *
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

from setuptools import setup, find_packages

VERSION = '1.0.0'

INSTALL_REQUIRES = [
'numpy',
'pytest',
Expand All @@ -16,7 +18,7 @@
]

setup(name='fgscountrate',
version='0.0',
version=VERSION,
description='JWST FGS countrate estimation',
long_description='JWST FGS countrate and magnitude estimation and related functionality.',
classifiers=[
Expand Down

0 comments on commit 54492cf

Please sign in to comment.