Skip to content

Commit d6ef412

Browse files
authored
Merge pull request #48 from vpython/mwcraig-patch-1
Update testing and packaging infrastructure
2 parents 3cf116d + 4893516 commit d6ef412

File tree

5 files changed

+123
-243
lines changed

5 files changed

+123
-243
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test/build
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
strategy:
9+
max-parallel: 4
10+
fail-fast: false
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8]
13+
platform: [ubuntu-latest, macos-latest, windows-latest]
14+
runs-on: ${{ matrix.platform }}
15+
16+
steps:
17+
18+
- uses: actions/checkout@v1
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Get pip cache location
26+
id: pip-cache
27+
run: |
28+
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
29+
30+
- uses: actions/cache@v1
31+
with:
32+
path: ${{ steps.pip-cache.outputs.dir }}
33+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
34+
restore-keys: |
35+
${{ runner.os }}-pip-
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install pytest Cython wheel
41+
42+
- name: Build sdist
43+
run: |
44+
python setup.py sdist
45+
46+
- name: Build wheel
47+
run: |
48+
python setup.py bdist_wheel
49+
50+
- name: Install vpython
51+
run: |
52+
pip install .
53+
54+
- name: Run tests
55+
run: |
56+
pytest vpython
57+
58+
- name: Import test
59+
run: |
60+
python -c "import vpython"

.github/workflows/upload_pypi.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Upload Python wheel to PyPI
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
wheels:
9+
10+
strategy:
11+
max-parallel: 4
12+
fail-fast: false
13+
matrix:
14+
python-version: [3.6, 3.7, 3.8]
15+
platform: [ubuntu-latest, macos-latest, windows-latest]
16+
runs-on: ${{ matrix.platform }}
17+
18+
steps:
19+
20+
- uses: actions/checkout@v1
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install setuptools wheel twine Cython
31+
32+
- name: Build and publish wheel
33+
env:
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_TOKEN }}
36+
run: |
37+
python setup.py bdist_wheel
38+
twine upload dist/*
39+
40+
sdist:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v1
44+
- name: Set up Python
45+
uses: actions/setup-python@v1
46+
with:
47+
python-version: '3.8'
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install setuptools wheel twine Cython
52+
- name: Build and publish
53+
env:
54+
TWINE_USERNAME: __token__
55+
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_TOKEN }}
56+
run: |
57+
python setup.py sdist
58+
twine upload dist/*

.travis.yml

Lines changed: 0 additions & 122 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 121 deletions
This file was deleted.

vpython/test/test_namespace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ def test_names_in_base_namspace():
158158
if python_version.major == 3 and python_version.minor >= 7:
159159
api_name_set.add('remainder')
160160

161+
# Python 3.8 added even more math functions.
162+
if python_version.major == 3 and python_version.minor >= 8:
163+
for name in ['dist', 'comb', 'prod', 'perm', 'isqrt']:
164+
api_name_set.add(name)
165+
161166
print(sorted(api_name_set - current_names))
162167

163168
# We may have added new names, so start with this weaker test

0 commit comments

Comments
 (0)