Skip to content
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
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build ⚙️

on: [ push, pull_request ]

jobs:
main:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v6
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install system packages
run: |
sudo apt-get update -qq
sudo apt-get install -y devscripts debhelper-compat dh-python python3-all python3-build pybuild-plugin-pyproject python3-setuptools python3-tomli python3-wheel
sudo pip3 install --upgrade setuptools wheel build
- name: Install package and dev requirements 📦
run: |
pip3 install .
pip3 install ".[dev]"
pip3 install ".[release]"
- name: run tests ⚙️
run: python3 tests/run_tests.py
- name: run flake8 ⚙️
run: |
xargs flake8
- name: build Python package 🏗️
run: python3 -m build
- name: test debian build
run: debuild -b -uc -us
continue-on-error: true
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.pyc
build
dist
woudc_extcsv.egg-info
MANIFEST
*.egg-info
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

103 changes: 47 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[![Build Status](https://travis-ci.org/woudc/woudc-extcsv.png?branch=master)](https://travis-ci.org/woudc/woudc-extcsv) [![Build status](https://ci.appveyor.com/api/projects/status/02koln2pe4ap5kvd/branch/master?svg=true)](https://ci.appveyor.com/project/tomkralidis/woudc-extcsv)
[![Downloads this month on PyPI](https://img.shields.io/pypi/dm/woudc-extcsv.svg)](http://pypi.python.org/pypi/woudc-extcsv)
[![Latest release](https://img.shields.io/pypi/v/woudc-extcsv.svg)](http://pypi.python.org/pypi/woudc-extcsv)
[![License](https://img.shields.io/github/license/woudc/woudc-extcsv.svg)](https://github.com/woudc/woudc-extcsv)
[![Build Status](https://github.com/woudc/woudc-extcsv/workflows/build%20%E2%9A%99%EF%B8%8F/badge.svg)](https://github.com/woudc/woudc-extcsv/actions)

# WOUDC Extended CSV library

Expand All @@ -10,24 +7,24 @@ Python package providing read/write support for files of the

## Installation

### Requirements
### pip

woudc-extcsv requires Python 3 or above. See `requirements.txt`.

### Development
Install latest stable version from [PyPI](https://pypi.org/project/woudc-extcsv).

```bash
# install dev requirements
pip install -r requirements-dev.txt
pip3 install woudc-extcsv
```

### Installing the Package
### From source
Install latest development version.

```bash
# via pip
pip install woudc-extcsv
# via easy_install
easy_install woudc-extcsv
python3 -m venv woudc-extcsv
cd woudc-extcsv
. bin/activate
git clone https://github.com/woudc/woudc-extcsv.git
cd woudc-extcsv
pip3 install .
```

## Usage
Expand All @@ -37,7 +34,7 @@ easy_install woudc-extcsv
```python
from woudc_extcsv import Reader
# read from file
with open('file.csv', 'r') as ff:
with open('file.csv') as ff:
ecsv = Reader(ff.read())
# read from string
ecsv = Reader(my_ecsv_string)
Expand Down Expand Up @@ -125,7 +122,7 @@ The ExtendedCSV class is a parser class used in the Reader and Writer classes, a
```python
from woudc_extcsv import ExtendedCSV
# read from file
with open('file.csv', 'r') as ff:
with open('file.csv') as ff:
ecsv = ExtendedCSV(ff.read())
# read from string
ecsv = Extended(my_ecsv_string)
Expand Down Expand Up @@ -164,54 +161,48 @@ except (NonStandardDataError, MetadataValidationError) as err:

## Development

For development environments, install
in a Python [virtualenv](http://virtualenv.org):

```bash
virtualenv foo
cd foo
. bin/activate
# fork master
# fork https://github.com/woudc/woudc-extcsv on GitHub
# clone your fork to create a branch
git clone https://github.com/{your GitHub username}/woudc-extcsv.git
python3 -m venv woudc-extcsv
cd woudc-extcsv
# install dev packages
pip install -r requirements-dev.txt
# create upstream remote
git remote add upstream https://github.com/woudc/woudc-extcsv.git
git pull upstream master
git branch my-cool-feature
git checkout my-cool-feature
# start dev
git commit -m 'implement cool feature'
# push to your fork
git push origin my-cool-feature
# issue Pull Request on GitHub
git checkout master
# cleanup/update once your branch is merged on GitHub
# remove branch
git branch -D my-cool-feature
# update your fork
git pull upstream master
git push origin master
source bin/activate
git clone https://github.com/woudc/woudc-extcsv.git
cd woudc-extcsv
pip3 install .
pip3 install ".[dev]"
```

### Running Tests

```bash
# via distutils
python setup.py test
# manually
python run_tests.py
# report test coverage
coverage run --source woudc_extcsv setup.py test
coverage report -m
python3 tests/run_tests.py
```

## Releasing

```bash
# create release (x.y.z is the release version)
vi pyproject.toml # update [project]/version
git commit -am 'update release version x.y.z'
git push origin master
git tag -a x.y.z -m 'tagging release version x.y.z'
git push --tags

# upload to PyPI
rm -fr build dist *.egg-info
python3 -m build
twine upload dist/*

# publish release on GitHub (https://github.com/woudc/woudc-extcsv/releases/new)

# bump version back to dev
vi pyproject.toml # update [project]/version
git commit -am 'back to dev'
git push origin master
```

### Code Conventions

woudc_extcsv code conventions are as per
woudc-extcsv code conventions are as per
[PEP8](https://www.python.org/dev/peps/pep-0008).

```bash
Expand All @@ -237,5 +228,5 @@ Board [Policy on Acceptable Network and Device Use]

## Contact

* [Tom Kralidis](http://geds20-sage20.ssc-spc.gc.ca/en/GEDS20/?pgid=015&dn=CN%3Dtom.kralidis%40canada.ca%2COU%3DDAT-GES%2COU%3DMON-STR%2COU%3DMON-DIR%2COU%3DMSCB-DGSMC%2COU%3DDMO-CSM%2COU%3DEC-EC%2CO%3Dgc%2CC%3Dca)
* [Thinesh Sornalingam](http://geds20-sage20.ssc-spc.gc.ca/en/GEDS20/?pgid=015&dn=CN%3Dthinesh.sornalingam%40canada.ca%2COU%3DDAT-GES%2COU%3DMON-STR%2COU%3DMON-DIR%2COU%3DMSCB-DGSMC%2COU%3DDMO-CSM%2COU%3DEC-EC%2CO%3DGC%2CC%3DCA)
* [Tom Kralidis](https://github.com/tomkralidis)
* [Thinesh Sornalingam](https://github.com/thineshsornalingam)
28 changes: 0 additions & 28 deletions appveyor.yml

This file was deleted.

1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Source: woudc-extcsv
Section: python
Priority: optional
Maintainer: WOUDC <woudc@ec.gc.ca>
Build-Depends: debhelper (>= 9), python3, python3-setuptools
Build-Depends: debhelper-compat (= 13), devscripts, dh-python, python3, python3-all, python3-build, pybuild-plugin-pyproject, python3-setuptools, python3-tomli, python3-wheel
Standards-Version: 3.9.5
X-Python-Version: >= 3.10
Vcs-Git: https://github.com/woudc/woudc-extcsv.git

Package: woudc-extcsv
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python3-pkg-resources, python3-unicodecsv
Depends: ${misc:Depends}, ${python:Depends}, python3-jsonschema, python3-pkg-resources, python3-unicodecsv, python3-yaml
Homepage: https://woudc.org
Description: WMO WOUDC format reader/writer
woudc-extcsv is a Python package providing parsing and read/write support of the
Expand Down
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_SYSTEM=pyproject

%:
dh $@ --with python3 --buildsystem=pybuild
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "woudc-extcsv"
version = "0.8.dev0"
description = "Python package providing read/write support of the WOUDC Extended CSV format."
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE.md"]
keywords = ["woudc", "ozone", "uv", "ultra-violet", "WMO", "Extended CSV"]
authors = [
{name = "Thinesh Sornalingam", email = "thinesh.sornalingam@ec.gc.ca"},
{name = "Tom Kralidis", email = "tomkralidis@gmail.com"}
]
maintainers = [
{name = "Tom Kralidis", email = "tomkralidis@gmail.com"},
{name = "Kevin Ngai", email = "kevin.ngai@ec.gc.ca"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Atmospheric Science"
]
dependencies = [
"jsonschema",
"pyyaml"
]

[project.optional-dependencies]
dev = ["Cython", "flake8"]
release = ["build", "twine", "wheel"]

[project.urls]
homepage = "https://github.com/woudc/woudc-extcsv"
source = "https://github.com/woudc/woudc-extcsv"
documentation = "https://github.com/woudc/woudc-extcsv"
issues = "https://github.com/woudc/woudc-extcsv/issues"

[tool.setuptools.package-data]
"woudc_extcsv.resources" = ["*.csv", "*.json", "*.yml"]
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

Loading