Skip to content

Commit a646777

Browse files
authored
Merge pull request #40 from ColCarroll/new-build
New build
2 parents 3e5590f + cf38c6d commit a646777

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
1-
name: ridge_map build
2-
on: [push]
1+
name: unittests & auto-publish
2+
on: [push, workflow_dispatch]
33
jobs:
4-
build:
5-
runs-on: ubuntu-18.04
6-
strategy:
7-
matrix:
8-
python-version: [3.6,3.7]
4+
pytest-job:
5+
runs-on: ubuntu-latest
6+
timeout-minutes: 30
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
910
steps:
10-
- uses: actions/checkout@v2
11-
- name: Setup python ${{ matrix.python-version }}
12-
uses: actions/setup-python@v2
11+
- uses: actions/checkout@v3
12+
13+
- uses: actions/setup-python@v4
1314
with:
14-
python-version: ${{ matrix.python-version }}
15-
- name: Install dependencies
16-
run: |
17-
python -m pip install .
18-
python -m pip install pydocstyle pytest pylint pytest-cov black coveralls
15+
python-version: "3.10"
16+
- run: pip --version
17+
- run: pip install .
18+
- run: pip install pydocstyle pytest pylint pytest-cov black
19+
- run: pip freeze
1920
- name: Run tests
2021
run: ./scripts/test.sh
22+
23+
# Auto-publish when version is increased
24+
publish-job:
25+
# Only try to publish if:
26+
# * Repo is self (prevents running from forks)
27+
# * Branch is `main`
28+
if: |
29+
github.repository == 'colcarroll/ridge_map'
30+
&& github.ref == 'refs/heads/main'
31+
needs: pytest-job # Only publish after tests are successful
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
timeout-minutes: 30
36+
37+
steps:
38+
# Publish the package (if local `__version__` > pip version)
39+
- uses: etils-actions/pypi-auto-publish@v1
40+
with:
41+
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
42+
gh-token: ${{ secrets.GITHUB_TOKEN }}
43+
parse-changelog: false

.pylintrc

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ unsafe-load-any-extension=no
5151
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
5252
confidence=
5353

54-
# Disable the message, report, category or checker with the given id(s). You
55-
# can either give multiple identifiers separated by comma (,) or put this
56-
# option multiple times (only on the command line, not in the configuration
57-
# file where it should appear only once). You can also use "--disable=all" to
58-
# disable everything first and then reenable specific checks. For example, if
59-
# you want to run only the similarities checker, you can use "--disable=all
60-
# --enable=similarities". If you want to run only the classes checker, but have
61-
# no Warning level messages displayed, use "--disable=all --enable=classes
62-
# --disable=W".
63-
disable=bad-continuation
64-
6554
# Enable the message, report, category or checker with the given id(s). You can
6655
# either give multiple identifier separated by comma (,) or put this option
6756
# multiple time (only on the command line, not in the configuration file where
@@ -127,13 +116,6 @@ max-line-length=100
127116
# Maximum number of lines in a module.
128117
max-module-lines=1000
129118

130-
# List of optional constructs for which whitespace checking is disabled. `dict-
131-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
132-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
133-
# `empty-line` allows space-only lines.
134-
no-space-check=trailing-comma,
135-
dict-separator
136-
137119
# Allow the body of a class to be on the same line as the declaration if body
138120
# contains single statement.
139121
single-line-class-stmt=no
@@ -491,5 +473,5 @@ min-public-methods=1
491473

492474
# Exceptions that will emit a warning when being caught. Defaults to
493475
# "BaseException, Exception".
494-
overgeneral-exceptions=BaseException,
495-
Exception
476+
overgeneral-exceptions=builtins.BaseException,
477+
builtins.Exception

ridge_map/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"""A library for plotting ridges with ridges."""
2+
23
__version__ = "0.0.4"
34
from .ridge_map import RidgeMap, FontManager

ridge_map/ridge_map.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""3D maps with 1D lines."""
2+
23
from urllib.request import urlopen
34
from tempfile import NamedTemporaryFile
45

@@ -255,7 +256,7 @@ def plot_map(
255256
fontproperties=self.font,
256257
size=label_size,
257258
verticalalignment=label_verticalalignment,
258-
bbox=dict(facecolor=background_color, alpha=1, linewidth=0),
259+
bbox={"facecolor": background_color, "alpha": 1, "linewidth": 0},
259260
zorder=len(values) + 10,
260261
)
261262

0 commit comments

Comments
 (0)