Skip to content

Commit

Permalink
Merge pull request #4 from astropenguin/#3-dev-environment
Browse files Browse the repository at this point in the history
Update dev environment
  • Loading branch information
astropenguin authored Aug 22, 2021
2 parents a94e2f9 + eca63bb commit 45df6ba
Show file tree
Hide file tree
Showing 17 changed files with 764 additions and 752 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
sudo apt install pandoc
pip install poetry
poetry install
- name: Build docs
run: poetry run scripts/docs
run: poetry run docs/build
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
pip install poetry
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name: Test
name: Tests

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
job:
name: Test
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9]
env:
TESTED_DIRS: docs tests xarray_accessors
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
Expand All @@ -26,11 +28,11 @@ jobs:
sudo apt install pandoc
pip install poetry
poetry install
- name: Lint by Flake8
run: poetry run flake8 docs tests xarray_accessors
- name: Format by Black
run: poetry run black --check docs tests xarray_accessors
- name: Test by pytest
- name: Test code format (Black)
run: poetry run black --check ${TESTED_DIRS}
- name: Test code style (Flake8)
run: poetry run flake8 ${TESTED_DIRS}
- name: Test package (pytest)
run : poetry run pytest -v tests
- name: Build docs
run: poetry run scripts/docs
- name: Test docs building (Sphinx)
run: poetry run docs/build
22 changes: 17 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Editor settings
.vscode
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -23,7 +24,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -53,6 +53,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -72,11 +73,12 @@ instance/
.scrapy

# Sphinx documentation
docs/readme.rst
docs/_apidoc/
docs/_build/
docs/readme.rst

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -87,7 +89,9 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down Expand Up @@ -132,3 +136,11 @@ dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.formatOnSave": true,
"python.analysis.typeCheckingMode": "strict",
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.flake8Enabled": true,
}
9 changes: 9 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"creators": [
{
"name": "Akio Taniguchi",
"affiliation": "Nagoya University",
"orcid": "0000-0002-9695-6183"
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Akio Taniguchi
Copyright (c) 2020-2021 Akio Taniguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[![Test](https://img.shields.io/github/workflow/status/astropenguin/xarray-accessors/Test?logo=github&label=Test&style=flat-square)](https://github.com/astropenguin/xarray-accessors/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&style=flat-square)](LICENSE)

xarray extension for dataarray accessors
xarray extension for easy accessor creation
14 changes: 7 additions & 7 deletions docs/_static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions scripts/docs → docs/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
# convert README.md to readme.rst
pandoc --column 500 -f markdown -t rst -o docs/readme.rst README.md


# auto-generate package guide
sphinx-apidoc -efT -o docs/_apidoc xarray_accessors


# build website
sphinx-build -a docs docs/_build
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project information
author = "Akio Taniguchi"
copyright = "2020, Akio Taniguchi"
copyright = "2020-2021, Akio Taniguchi"


# General configuration
Expand Down
Loading

0 comments on commit 45df6ba

Please sign in to comment.