Skip to content

Commit

Permalink
Update version numbers and prepare for GCPy 1.4.2 release
Browse files Browse the repository at this point in the history
CHANGELOG.md
docs/source/conf.py
gcpy/_version.py
gcpy/benchmark/run_benchmark.py
gcpy/benchmark/modules/run_1yr_fullchem_benchmark.py
gcpy/benchmark/modules/run_1yr_tt_benchmark.py
CHANGELOG.md
- Updated version numbers

setup.py
- Restored, now use same version numbers as in environment.yml

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Jan 26, 2024
1 parent 1dffa6c commit 70d649a
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 11 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ All notable changes to GCPy will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - TBD
## [1.4.2] - 2024-01-26
### Added
- Example script `create_test_plot.py`, which can be used to check that GCPy has been installed properly
- GitHub action `build-gcpy-environment` which tests installation of the mamba environment specified in in `docs/environment_files/environment.yml`
- YAML file`docs/environment_files/testing.yml` for building an environment without pegged package versions (for testing)
- GitHub action `build-test-environment` to test the environment specified in `testing.yml`

### Changed
- `build-gcpy-environment`

- `build-gcpy-environment` GitHub action now runs with several Python versions

### Fixed
- Prevent overwriting of the `results` variable when parallel plotting is deactivated (`n_cores: 1`)
Expand Down
6 changes: 3 additions & 3 deletions docs/source/Release_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ versions of GCPy on Github, PyPi, and conda-forge.
- :file:`setup.py`
- :file:`gcpy/_version.py`
- :file:`docs/source/conf.py`
- :file:`benchmark/run_benchmark.py`
- :file:`benchmark/modules/run_1yr_fullchem_benchmark.py`
- :file:`benchmark/modules/run_1yr_tt_benchmark.py`
- :file:`gcpy/benchmark/run_benchmark.py`
- :file:`gcpy/benchmark/modules/run_1yr_fullchem_benchmark.py`
- :file:`gcpy/benchmark/modules/run_1yr_tt_benchmark.py`
|br|

#. Update :file:`CHANGELOG.md` |br|
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'GEOS-Chem Support Team'

# The full version, including alpha/beta/rc tags
release = '1.4.1'
release = '1.4.2'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion gcpy/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.4.2'

__version__ = '1.4.1'
2 changes: 1 addition & 1 deletion gcpy/benchmark/modules/run_1yr_fullchem_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
https://github.com/ipython/ipython/issues/10627
This script corresponds with GCPy 1.4.0. Edit this version ID if releasing
This script corresponds with GCPy 1.4.2. Edit this version ID if releasing
a new version of GCPy.
"""

Expand Down
2 changes: 1 addition & 1 deletion gcpy/benchmark/modules/run_1yr_tt_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
https://github.com/ipython/ipython/issues/10627
This script corresponds with GCPy 1.4.0. Edit this version ID if releasing
This script corresponds with GCPy 1.4.2. Edit this version ID if releasing
a new version of GCPy.
"""

Expand Down
2 changes: 1 addition & 1 deletion gcpy/benchmark/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
https://github.com/ipython/ipython/issues/10627
This script corresponds with GCPy 1.4.0. Edit this version ID if releasing
This script corresponds with GCPy 1.4.2. Edit this version ID if releasing
a new version of GCPy.
"""

Expand Down
144 changes: 144 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#!/usr/bin/env python

import os
import warnings

from setuptools import setup, find_packages

from textwrap import dedent

DESCRIPTION = ""
LONG_DESCRIPTION = """\
Python toolkit for working with GEOS-Chem output.
"""

DISTNAME = "geoschem-gcpy"
AUTHOR = "GEOS-Chem Support Team"
AUTHOR_EMAIL = "[email protected]"
URL = "https://github.com/geoschem/gcpy"
LICENSE = "MIT"

CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering',
]

MAJOR = 1
MINOR = 4
MICRO = 2
EXTRA = '' # for alpha (aN), beta (bN), rc (rcN) versions

VERSION = f"{MAJOR}.{MINOR}.{MICRO}{EXTRA}"
'''
#DEV format (using git hash) is intriguing but incompatible with PEP 440
#No hashes can be used in version field
DEV = True
# Correct versioning with git info if DEV
if DEV:
import subprocess
pipe = subprocess.Popen(
['git', "describe", "--always", "--match", "v[0-9]*"],
stdout=subprocess.PIPE)
so, err = pipe.communicate()
if pipe.returncode != 0:
# no git or something wrong with git (not in dir?)
warnings.warn("WARNING: Couldn't identify git revision, using generic version string")
VERSION += ".dev"
else:
git_rev = so.strip()
git_rev = git_rev.decode('ascii') # necessary for Python >= 3
VERSION += ".dev-{}".format(git_rev)
'''

def _write_version_file():

fn = os.path.join(os.path.dirname(__file__), 'gcpy', '_version.py')

version_str = dedent("""
__version__ = '{}'
""")

# Write version file
with open(fn, 'w') as version_file:
version_file.write(version_str.format(VERSION))

# Write version and install
_write_version_file()

setup(
name = DISTNAME,
author = AUTHOR,
author_email = AUTHOR_EMAIL,
maintainer = AUTHOR,
maintainer_email = AUTHOR_EMAIL,
description = DESCRIPTION,
long_description = LONG_DESCRIPTION,
license = LICENSE,
url = URL,
version = VERSION,
packages = find_packages(),
include_package_data=True,
install_requires=[
"awscli==2.13.39",
"cartopy==0.22.0",
"cf_xarray==0.8.4",
"dask==2023.9.2",
"gridspec==0.1.0",
"ipython==8.15.0",
"joblib==1.3.2",
"jupyter==1.0.0",
"matplotlib==3.8.0",
"netcdf4==1.6.0",
"netcdf-fortran==4.5.4",
"numpy==1.26.0",
"pandas==2.1.1",
"pip==23.2.1",
"pylint==2.17.5",
"pyproj==3.6.1",
"python==3.9.18",
"pypdf==3.16.1",
"recommonmark==0.7.1",
"requests==2.31.0",
"scipy==1.11.2",
"sparselt==0.1.3",
"tabulate==0.9.0",
"tk==8.6.12",
"xarray==2023.8.0",
"esmf==8.1.1",
"esmpy==8.1.1",
"xesmf==0.5.1",
"docutils==0.16",
"jinja2==3.0.3",
"sphinx==3.5.4",
"sphinx-autoapi==1.9.0",
"sphinx-autobuild==2021.3.14",
"sphinxcontrib-bibtex==2.2.0",
"sphinx_rtd_theme==0.5.2",
],
classifiers = CLASSIFIERS
)


'''
Instructions for publishing new version to TestPyPi (mimics PyPi) and PyPi:
1. Update version numbers above and in _version.py and commit before releasing
2. Install twine if not available (pip install twine)
3. run python setup.py sdist bdist_wheel
4. run twine check dist/*
5. run twine upload --repository-url https://test.pypi.org/legacy/ dist/*
6. Test installation in a virtual environment using pip install --extra-index-url https://test.pypi.org/simple/ geoschem-gcpy
7. To publish to PyPi, run twine upload dist/*
'''

0 comments on commit 70d649a

Please sign in to comment.