Skip to content

Commit

Permalink
Moving from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagasaki45 committed Jun 15, 2024
1 parent 59ccaca commit 0d2d59d
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI Pipeline

on: [push]

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup BibTex
uses: teatimeguest/setup-texlive-action@v3
with:
packages: bibtex

- name: Setup xclip
run: sudo apt-get -yq install xclip

- name: Install dependencies
run: pip install .[dev]

- name: Run unit tests with XVFB
uses: coactions/setup-xvfb@v1
with:
run: coverage run -m pytest

- name: Check code formatting
run: black . --check

- name: Type check
run: mypy .

# - name: Upload coverage report
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Moving from Travis-CI to GitHub Actions.

## [0.1.7] - 2022-03-09

### Changed
Expand Down
2 changes: 1 addition & 1 deletion bibo/bibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import click_constraints
import click_plugins # type: ignore
import pybibs
import pylatexenc.latex2text
import pylatexenc.latex2text # type: ignore
import pyperclip # type: ignore
import requests

Expand Down
3 changes: 2 additions & 1 deletion bibo/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pybibs

from . import models
from typing import Optional

BIBO_DATABASE_ENV_VAR = "BIBO_DATABASE"
_ANSI_BOLD = "\033[1m"
Expand Down Expand Up @@ -223,7 +224,7 @@ def highlight_text(text: str, highlight: str) -> str:


def highlight_match(
text: str, result: models.SearchResult, extra_match_info: dict = None
text: str, result: models.SearchResult, extra_match_info: Optional[dict] = None
) -> typing.Tuple[str, dict]:
"""
Highlight `text` with `result.match` info. Every bit of info that is in
Expand Down
2 changes: 1 addition & 1 deletion bibo/stubs/pylatexenc/latex2text.pyi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class LatexNodes2Text:
def latex_to_text(self, latex: str) -> str: ...
def latex_to_text(self, latex: str) -> str: ...
8 changes: 5 additions & 3 deletions docs/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ Then, preferably in a virtual environment, run
pip install -e .[dev]
Running tests
-------------
Running tests, code formatting and and type checking
----------------------------------------------------

.. code-block:: bash
pytest
black . --check
mypy .
It automatically checks code formatting with `black <https://github.com/psf/black>`_. If code formatting errors are detected they can be manually fixed, or try running ``black .``.
If code formatting errors are detected they can be manually fixed, or try running ``black .``.


Generating the documentation
Expand Down
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
"codecov",
"mypy",
"pytest",
"pytest-black",
"pytest-mypy",
"sphinx",
"sphinx-click",
"types-requests",
Expand Down

0 comments on commit 0d2d59d

Please sign in to comment.