Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 52 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: report python version
run: python --version
- name: Install linters and formatters
run: python -m pip install flake8 black mypy
- name: Install poetry
run: python -m pip install poetry
- name: Initialize project
run: |
python -m poetry install --all-extras
python -m poetry install
python -m poetry run python scripts/fetch_core.py
- name: Check formatting with black
run: python -m poetry run black --check --diff $(git ls-files "*.py")
Expand All @@ -29,7 +31,48 @@ jobs:
- name: Check types
run: python -m poetry run mypy --install-types --non-interactive

tests:
deep-test:
needs: format-and-types
runs-on: ubuntu-22.04
#container: oscarlevin/pretext:full

steps:
- uses: actions/checkout@v3

- name: Report Python version
run: python --version

- name: Install apt packages (Linux with python 3.12 only)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends texlive texlive-science texlive-xetex ghostscript pdf2svg texlive-fonts-extra sagemath python3-pip

- name: Install poetry 1.8.4
run: |
python -m pip install --upgrade pip
python -m pip install poetry==1.8.4

- name: View poetry --help
run: poetry --help

- name: Install dependencies
shell: bash
run: |
python -m poetry install --all-extras
python -m poetry run python scripts/fetch_core.py

- name: Ensure dependencies are present
run: |
echo "manually installing pelican; poetry does not seem to do this correctly."
python -m poetry run pip install pelican
python -m poetry run pelican --version

- name: Test with pytest
run: |
python -m poetry run pytest -v --cov


broad-tests:
needs: format-and-types
strategy:
fail-fast: true
Expand All @@ -46,6 +89,8 @@ jobs:
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"

runs-on: ${{ matrix.os }}

Expand All @@ -57,13 +102,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install apt packages (Linux with python 3.12 only)
if: runner.os == 'Linux' && matrix.python-version == '3.12'
run: |
sudo apt update
sudo apt install -y --no-install-recommends texlive texlive-science texlive-xetex ghostscript pdf2svg texlive-fonts-extra sagemath


- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
Expand All @@ -73,6 +111,10 @@ jobs:
- name: View poetry --help
run: poetry --help

- name: Install build dependencies if on Linux
if: runner.os == 'Linux'
run: sudo apt-get -y install libcairo2-dev pkg-config python3-dev

- name: Install dependencies
shell: bash
run: |
Expand All @@ -89,6 +131,7 @@ jobs:
run: |
python -m poetry run pytest -v --cov


schema:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change

## [Unreleased]

### Changed

- Improved help when deploy fails.

## [2.11.4] - 2025-01-11

Includes updates to core through commit: [42236bf](https://github.com/PreTeXtBook/pretext/commit/42236bf454d9e3f98bc25f0bb5186029710f17f7)
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pretext/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,16 +729,16 @@ def publish_to_ghpages(directory: Path, update_source: bool) -> None:
)
log.info("")
log.info(
"If you haven't already, configure SSH with GitHub by following instructions at:"
"Make sure you have set up authentication for GitHub. For more information, visit:"
)
log.info(" https://docs.github.com/en/authentication")
log.info(
" https://docs.github.com/en/authentication/connecting-to-github-with-ssh"
"Make sure you can push changes, either from the command line or in VS Code. Then try to deploy again."
)
log.info("Then try to deploy again.")
log.info("")
log.info(f"If `{origin.url}` doesn't match your GitHub repository,")
log.info(f"(If `{origin.url}` doesn't match your GitHub repository,")
log.info(
"use `git remote remove origin` on the command line then try to deploy again."
"use `git remote remove origin` on the command line then try to deploy again.)"
)
log.info("")
log.error("Deploy was unsuccessful.")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jinja2 = "^3"
pelican = { extras = ["markdown"], version = "^4.10", optional = true }
prefig = { extras = ["pycairo"], version = "^0.2.10", optional = true }


# Development dependencies
# ------------------------
[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 2 additions & 0 deletions templates/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ bh_unicode_properties.cache
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

# Don't track common virtual environment directories
venv/

# Don't include Dropbox settings and caches
.dropbox
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_custom_xsl(tmp_path: Path, script_runner: ScriptRunner) -> None:
assert (custom_path / "output" / "test2").exists()


@pytest.mark.skip(reason="secondary webwork server not currently available")
# @pytest.mark.skip(reason="secondary webwork server not currently available")
def test_custom_webwork_server(tmp_path: Path, script_runner: ScriptRunner) -> None:
custom_path = tmp_path / "custom"
shutil.copytree(EXAMPLES_DIR / "projects" / "custom-wwserver", custom_path)
Expand Down
Loading