Skip to content

Commit

Permalink
Merge pull request #61 from yvaucher/build-py-versions
Browse files Browse the repository at this point in the history
Test python 3.6, 3.7 and 3.8
  • Loading branch information
yvaucher authored Oct 13, 2021
2 parents 7b57217 + b4c3e2d commit e67d784
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 34 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test and publish

on:
push:
branches:
- "master"
tags:
- "*.*.*"
pull_request:

jobs:

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install tox
run: pip install tox
- name: Run lint
run: tox -e lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install -U pip
pip install -U setuptools
apt update
apt install -y build-essential libpq-dev python-dev
- name: Install tox
run: pip install tox
- name: Run tox
# Run tox using the version of Python in `PATH`
run: tox -e py

deploy:
runs-on: ubuntu-latest
needs: [lint, test]
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install -U pip
pip install -U wheel setuptools
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Unreleased

**Build**

* Test for python 3.6, 3.7 and 3.8

0.10.6 (2021-09-14)
+++++++++++++++++++

Expand Down
4 changes: 2 additions & 2 deletions marabunta/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from __future__ import print_function


import io
from ruamel.yaml import YAML
import warnings

Expand Down Expand Up @@ -92,7 +92,7 @@ def parser_from_buffer(cls, fp):
@classmethod
def parse_from_file(cls, filename):
"""Construct YamlParser from a filename."""
with open(filename, 'r') as fh:
with io.open(filename, 'r', encoding='utf-8') as fh:
return cls.parser_from_buffer(fh)

def check_dict_expected_keys(self, expected_keys, current, dict_name):
Expand Down
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-
import sys

from setuptools import setup, find_packages

with open('README.rst') as f:
readme = f.read()
if (sys.version_info[:3] < (3, 0)):
with open('README.rst') as f:
readme = f.read()
else:
with open('README.rst', encoding='utf-8') as f:
readme = f.read()
with open('HISTORY.rst') as f:
history = f.read()

Expand Down Expand Up @@ -54,6 +59,10 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
),
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[tox]
envlist = py27,py35,lint
envlist = py27,py35,py36,py37,py38,lint

[testenv]
deps = .[test]
extras = test
commands = py.test {posargs}

[testenv:lint]
basepython = python3.5
basepython = python3.9
skip_install=true
deps =
flake8
readme_renderer
Expand Down

0 comments on commit e67d784

Please sign in to comment.