Skip to content

Commit

Permalink
Merge pull request #68 from pyoceans/package-cleanup
Browse files Browse the repository at this point in the history
Actions, flakes, and pre-commit cleanup
  • Loading branch information
kwilcox authored Mar 3, 2022
2 parents a449326 + e82fbc2 commit 11ad6b8
Show file tree
Hide file tree
Showing 23 changed files with 244 additions and 295 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: Publish to PyPI

on:
release:
types:
- published

jobs:

pypi-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install pocean_core*.whl
python -m twine check *
shell: bash

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
84 changes: 84 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Push

on:
push:
workflow_dispatch:
pull_request:

jobs:

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
activate-conda: false
conda-channels: conda-forge

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: |
conda create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt
source activate TEST
pip install -e . --no-deps --force-reinstall
- name: Debug conda
shell: bash -l {0}
run: |
source activate TEST
conda info --all
conda list
- name: Tests
shell: bash -l {0}
run: |
source activate TEST
pytest --disable-warnings
pypi-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install pocean_core*.whl
python -m twine check *
shell: bash
39 changes: 0 additions & 39 deletions .github/workflows/tests.yml

This file was deleted.

30 changes: 14 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: end-of-file-fixer
files: .*\.*.py
- id: trailing-whitespace
- id: check-ast
files: .*\.*.py
- id: debug-statements
- id: end-of-file-fixer
exclude: github_deploy_key.enc
- id: check-ast
- id: check-added-large-files
exclude_types: [yaml]
- id: check-json
- id: check-merge-conflict
- id: check-yaml
- id: requirements-txt-fixer
- id: file-contents-sorter
files: requirements-dev.txt
args:
- requirements.txt
- requirements-dev.txt

- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: codespell
args:
- --ignore-words-list=te
exclude: >
(?x)^(
.*\.yaml
)$
- id: flake8
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Axiom Data Science
Copyright (c) 2022 Axiom Data Science

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
46 changes: 0 additions & 46 deletions conda-recipe/meta.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Create a conda environment

...code bash

$ conda create -n pocean37 python=3.7
$ source activate pocean37
$ conda install --file requirements.txt --file requirements-test.txt
$ conda create -n pocean310 python=3.10
$ source activate pocean310
$ conda install --file requirements.txt --file requirements-dev.txt


Running tests
Expand Down
Loading

0 comments on commit 11ad6b8

Please sign in to comment.