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

Prepare to release #3

Merged
merged 3 commits into from
Jul 6, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/pytests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Install wxflow and run tests with pytests
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- name: Setup Python
Expand All @@ -30,4 +30,4 @@ jobs:
- name: Run pytests
run: |
cd $GITHUB_WORKSPACE
pytest -v src/tests
pytest -v
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Python distributions to PyPI

on:
release:
types: [published]

jobs:
build-and-publish:
name: Build and publish Python distribution to PyPI
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: |
python3 -m pip install build --user

- name: Build a binary wheel and a source tarball
run: |
python3 -m build --sdist --wheel --outdir dist/ .

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
[![pynorms](https://github.com/NOAA-EMC/wxflow/actions/workflows/pynorms.yaml/badge.svg)](https://github.com/NOAA-EMC/wxflow/actions/workflows/pynorms.yaml)
[![pytests](https://github.com/NOAA-EMC/wxflow/actions/workflows/pytests.yaml/badge.svg)](https://github.com/NOAA-EMC/wxflow/actions/workflows/pytests.yaml)
![PyPI](https://img.shields.io/pypi/v/:wxflow)

# Tools for Weather Workflows

Common set of tools used in weather workflows

## Installation
Simple installation instructions
```sh
$> git clone https://github.com/noaa-emc/wxflow
$> cd wxflow
$> pip install .
$> pip install wxflow
```

It is not required to install this package. Instead,
```sh
$> cd wxflow
$> export PYTHONPATH=${PWD}/src/wxflow
```
would put this package in the `PYTHONPATH`

### Note:
These instructions will be updated and the tools are under development.

### Running python tests:
Simple instructions to enable executing pytests manually
```sh
Expand All @@ -38,3 +26,18 @@ $> source venv/bin/activate
# Run pytests
(venv) $> pytest -v
```

# Disclaimer

The United States Department of Commerce (DOC) GitHub project code is provided
on an "as is" basis and the user assumes responsibility for its use. DOC has
relinquished control of the information and no longer has responsibility to
protect the integrity, confidentiality, or availability of the information. Any
claims against the Department of Commerce stemming from the use of its GitHub
project will be governed by all applicable Federal law. Any reference to
specific commercial products, processes, or services by service mark,
trademark, manufacturer, or otherwise, does not constitute or imply their
endorsement, recommendation or favoring by the Department of Commerce. The
Department of Commerce seal and logo, or the seal and logo of a DOC bureau,
shall not be used in any manner to imply endorsement of any commercial product
or activity by DOC or the United States Government.
46 changes: 0 additions & 46 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,3 @@
[project]
name = "wxflow"
version = "0.1.0"
description = "Tools for Weather Workflows"
readme = "README.md"
requires-python = ">=3.6"
license = {file = "LICENSE.md"}
keywords = ["NWP", "Workflow"]
authors = [
{name = "NOAA/NWS/NCEP/EMC", email = "First.Last@noaa.gov" }
]
maintainers = [
{name = "NOAA/NWS/NCEP/EMC", email = "First.Last@noaa.gov" }
]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Lesser General Public License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]

dependencies = [
"numpy>=1.21.6",
"PyYAML>=6.0",
"Jinja2>=3.1.2"
]

[project.optional-dependencies]
dev = ["check-manifest", "pytest>=7", "pytest-cov[all]"]
test = ["pytest>=7", "pytest-cov[all]"]
lint = ["pycodestyle"]

[project.urls]
"Homepage" = "https://github.com/NOAA-EMC/wxflow"
"Bug Reports" = "https://github.com/NOAA-EMC/wxflow/issues"
"Source" = "https://github.com/NOAA-EMC/wxflow/"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
63 changes: 63 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[metadata]
name = wxflow
version = attr: wxflow.__version__
description = Tools for Weather Workflows
long_description = file: README.md
long_description_content_type = text/markdown
author = NOAA/NWS/NCEP/EMC
#author_email = first.last@domain.tld
keywords = NOAA, NWS, NCEP, EMC
home_page = https://github.com/noaa-emc/wxflow
license = GNU Lesser General Public License v3 or later (LGPLv3+)
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: GNU Lesser General Public License
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you specify Python :: 3 here, why do you need to include 3.7 - 3.11? My understanding was that `Python :: 3`` should cover all Python version 3 releases. Is this just decorative?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the underlying code will not work w/ 3.6 or below because the dependencies have become deprecated.
I urge you to try and install this w/ e.g. 3.5

Copy link
Contributor

@HenryRWinterbottom HenryRWinterbottom Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you. I was just curious as to what your reasoning was here. I see you addressed this here and here. Maybe this is OK.

Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: OS Independent
Typing :: Typed
project_urls =
Bug Tracker = https://github.com/noaa-emc/wxflow/issues
CI = https://github.com/noaa-emc/wxflow/actions

[options]
zip_safe = False
include_package_data = True
package_dir =
=src
packages = find_namespace:
python_requires = >= 3.6
setup_requires =
setuptools
install_requires =
numpy>=1.21.6
PyYAML>=6.0
Jinja2>=3.1.2
tests_require =
pytest

[options.packages.find]
where=src

[options.package_data]
* = *.txt, *.md

[options.extras_require]
dev = pytest>=7; pytest-cov>=3

[green]
file-pattern = test_*.py
verbose = 2
no-skip-report = true
quiet-stdout = true
run-coverage = true
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
''' Standard file for building the package with Distutils. '''

import setuptools
setuptools.setup()
21 changes: 16 additions & 5 deletions src/wxflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
"""
Commonly used toolset for the global applications and beyond.
"""
__docformat__ = "restructuredtext"

import os

from .yaml_file import YAMLFile, parse_yaml, parse_yamltmpl, parse_j2yaml, save_as_yaml, dump_as_yaml, vanilla_yaml
from .timetools import *
from .template import TemplateConstants, Template
from .task import Task
from .logger import Logger, logit
from .jinja import Jinja
from .fsutils import mkdir, mkdir_p, rmdir, chdir, rm_p, cp
from .file_utils import FileHandler
from .factory import Factory
from .executable import Executable, which, CommandNotFoundError
from .exceptions import WorkflowException, msg_except_handle
from .configuration import Configuration, cast_strdict_as_dtypedict, cast_as_dtype
from .attrdict import AttrDict

__docformat__ = "restructuredtext"
__version__ = "0.1.0"
wxflow_directory = os.path.dirname(__file__)
2 changes: 2 additions & 0 deletions src/wxflow/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from typing import Union, List
import logging

__all__ = ['Logger', 'logit']


class ColoredFormatter(logging.Formatter):
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.