Skip to content

orders v2: move to nox/github actions from tox/travis-ci #259

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

Closed
wants to merge 11 commits into from
Closed
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test

on: [pull_request]

jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip
- name: Test
run: |
pip install --upgrade nox
nox -s test-${{ matrix.python-version }}

lint:
name: Check Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip
- name: Lint
run: |
pip install --upgrade nox
nox -s lint




14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
GH_PAGES_SOURCES = planet docs Makefile

check:
py.test --doctest-modules planet tests
flake8 planet tests

coverage:
py.test --doctest-modules --cov planet --cov-report=html:htmlcov tests planet/api

pex:
# disable-cache seemed required or the older version would be used
pex . -o dist/planet -e planet.scripts:main --disable-cache
Expand Down
41 changes: 41 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import nox

nox.options.stop_on_first_error = True
nox.options.reuse_existing_virtualenvs = True
# nox.options.keywords = "test + check"

source_files = ("planet", "tests", "setup.py", "noxfile.py")
# docs_requirements = ("mkdocs", "mkdocs-material", "mkautodoc>=0.1.0")


@nox.session(python=["3.7", "3.8", "3.9"])
def test(session):
session.install("-e", ".[test]")

options = session.posargs
if "-k" or "-x" in options:
options.append("--no-cov")

session.run("pytest", "-v", *options)


@nox.session
def lint(session):
session.install("-e", ".[dev]")

session.run("flake8", *source_files)

# @nox.session
# def docs(session):
# session.install("--upgrade", *docs_requirements)
# session.install("-e", ".")
#
# session.run("mkdocs", "build")
#
#
# @nox.session(reuse_venv=True)
# def watch(session):
# session.install("--upgrade", *docs_requirements)
# session.install("-e", ".")
#
# session.run("mkdocs", "serve")
60 changes: 0 additions & 60 deletions planet/api/_fatomic.py

This file was deleted.

4 changes: 0 additions & 4 deletions requirements-dev.txt

This file was deleted.

17 changes: 17 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@ universal: 1

[metadata]
license_file: LICENSE

[tool:pytest]
addopts =
--cov=planet
--cov=tests
--cov-report=term-missing
--cov-report=xml
--cov-fail-under 95.69
-rxXs

[coverage:run]
source = planet,tests
branch = True

[coverage:report]
skip_covered = True
show_missing = True
34 changes: 13 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path

from codecs import open as codecs_open
from setuptools import setup, find_packages


# Get the long description from the relevant file
# TODO: consider moving to markdown from rst at this point
try:
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
except:
# @todo for now, fall back to this - pex fails to resolve the README
long_description = ''


with open('planet/api/__version__.py') as f:
for line in f:
if line.find("__version__") >= 0:
Expand All @@ -35,25 +24,28 @@
continue


install_requires = [
'httpx>=0.16',
'tqdm>=4.56',
'pywin32 >= 1.0;platform_system=="Windows"'
]

test_requires = [
'pytest',
'pytest-asyncio',
'respx'
'pytest-cov',
'respx==0.16.3'
]

dev_requires = [
lint_requires = [
'flake8',
'setuptools',
'pex',
'pytest-cov',
'sphinx',
'wheel',
]


setup(name='planet',
version=version,
description=u"Planet API Client",
long_description=long_description,
long_description=Path("README.md").read_text("utf-8"),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
Expand Down Expand Up @@ -82,7 +74,7 @@
],
extras_require={
'test': test_requires,
'dev': test_requires + dev_requires,
'dev': test_requires + lint_requires,
},
entry_points="""
[console_scripts]
Expand Down
53 changes: 0 additions & 53 deletions tests/unit/test_atomic.py

This file was deleted.

13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.