Skip to content
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

Add github workflow #362

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
52be116
Add github workflow, first set up python
cristianMeli Nov 15, 2021
08023e7
Add a sample test to run workflow
cristianMeli Nov 15, 2021
12fedd2
Change branch: master to main
cristianMeli Nov 15, 2021
16e3565
Remove travis.yml
cristianMeli Nov 15, 2021
189a6c8
Fix github workflow
cristianMeli Nov 15, 2021
fdfc056
Add test step
cristianMeli Nov 15, 2021
993d991
Add test step
cristianMeli Nov 15, 2021
0e4fe45
Matrix refactor
cristianMeli Nov 15, 2021
81dc4a2
Fix matrix refactor
cristianMeli Nov 15, 2021
5ab1f67
Add deploy and try ubuntu14.04
cristianMeli Nov 19, 2021
4cfbfee
Fix if container
cristianMeli Nov 19, 2021
a705623
Fix access to matrix.container
cristianMeli Nov 19, 2021
7b4ed0c
Add image variable to matrix
cristianMeli Nov 24, 2021
262a444
Add image variable to all matrix items
cristianMeli Nov 24, 2021
eee463a
Replace expresion for string in docker uses
cristianMeli Nov 24, 2021
1f26c52
Fix uses docker image
cristianMeli Dec 1, 2021
6fedc12
Use container instead of uses docker
cristianMeli Dec 18, 2021
ec7ed05
Uses docker ubuntu trusty in setup container
cristianMeli Dec 18, 2021
9f40a32
Remove images from matrix and try to fix if
cristianMeli Dec 18, 2021
6a1c951
Fix if, I forgot double quote
cristianMeli Dec 18, 2021
deb8347
Replace double quotes for single quotes
cristianMeli Dec 18, 2021
79ee304
Move uses docker at all steps level, and use expressions
cristianMeli Dec 18, 2021
30da5e4
Test without expresion
cristianMeli Dec 18, 2021
912de0e
Try pypy3.6
cristianMeli Dec 18, 2021
c6408bb
Add pypy 2.7.13
cristianMeli Dec 18, 2021
45ca178
Try pip cache
cristianMeli Dec 18, 2021
1d846bb
Add sample matrix attribute to test cache
cristianMeli Dec 18, 2021
063fd51
Add other python versions
cristianMeli Dec 18, 2021
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
123 changes: 123 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: main

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read

strategy:
fail-fast: false
matrix:
name: [
"py-27",
"py-33",
"py-34",
"py-35",
"py-36",
"py-37",
"py-38",
"py-39",
"pypy-36",
"pypy-27"
]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other Python versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is still in progress, I will add the other Python versions.
I converted the PR to draft.


include:
- name: "py-27"
python: "2.7"
os: ubuntu-latest
- name: "py-33"
python: "3.3"
os: ubuntu-latest
container: true
- name: "py-34"
python: "3.4"
os: ubuntu-latest
container: true
- name: "py-35"
python: "3.5"
os: ubuntu-latest
- name: "py-36"
python: "3.6"
os: ubuntu-latest
- name: "py-37"
python: "3.7"
os: ubuntu-latest
- name: "py-38"
python: "3.8"
os: ubuntu-latest
- name: "py-39"
python: "3.9"
os: ubuntu-latest
- name: "pypy-36"
python: "pypy-3.6-v7.3.2"
os: ubuntu-latest
container: true
- name: "pypy-27"
python: "pypy-2.7.13-v7.3.2"
os: ubuntu-latest
container: true

steps:
- uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4 is the latest version of actions/checkout currently.

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: docker://ubuntu:trusty
if: "matrix.container"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-


- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v5 is the latest version of actions/setup-python currently.

Suggested change
uses: actions/setup-python@v2
uses: actions/setup-python@v5

with:
python-version: ${{ matrix.python-versions }}

- name: Install dependencies
run: |
pip install --upgrade --force-reinstall "setuptools; python_version != '3.3'" "setuptools < 40; python_version == '3.3'"
pip uninstall --yes six || true
pip install --upgrade --force-reinstall --ignore-installed -e .
pip install "pytest==4.6.9; python_version != '3.3'" "pytest==2.9.2; python_version == '3.3'" "typing; python_version < '3'"
pip list --format=columns || pip list

- name: Test
run: |
py.test
echo Checking whether installation flow is not broken...
pip uninstall --yes six || true
pip install --ignore-installed .
pip list --format=columns || pip list

deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [build]

steps:
- uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4 is the latest version of actions/checkout currently.

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v4


- name: Set up Python
uses: actions/setup-python@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v5 is the latest version of actions/setup-python currently.

Suggested change
uses: actions/setup-python@v2
uses: actions/setup-python@v5

with:
python-version: "3.9"

- name: Install dependencies
run: |
pip install wheel

- name: Build package
run: |
python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

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

This file was deleted.

5 changes: 5 additions & 0 deletions test_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,3 +1050,8 @@ def test_ensure_text(self):
assert converted_unicode == self.UNICODE_EMOJI and isinstance(converted_unicode, str)
# PY3: bytes -> str
assert converted_binary == self.UNICODE_EMOJI and isinstance(converted_unicode, str)


def test_foo():
foo = "FOO"
assert foo == "FOO"
Comment on lines +1053 to +1057
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was added for debug purposes and should be removed from the final version.

Suggested change
def test_foo():
foo = "FOO"
assert foo == "FOO"