-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
174 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: PUBLISH | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python 3.12" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install pdm | ||
- name: "Build" | ||
run: | | ||
pdm install --no-self | ||
pdm build | ||
- name: "Publish pypi" | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
pdm config repository.pypi.username "__token__" | ||
pdm config repository.pypi.password "$PYPI_TOKEN" | ||
pdm publish | ||
- name: "Create release" | ||
run: | | ||
pdm run python tools/create_release.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.ref_name }} README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: TEST | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
|
||
code: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.11", "3.12" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python ${{ matrix.python-version }}" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install pdm | ||
pdm install --no-self | ||
- name: "Run tests" | ||
run: | | ||
pdm run pytest |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# Copyright (C) 2024 by Vd <ubump@vd2.org>. | ||
# This file is part of ubump project. | ||
# ubump is released under the MIT License (see LICENSE). | ||
|
||
|
||
from unittest import mock | ||
|
||
from ubump import main | ||
|
||
|
||
def test_config(): | ||
with mock.patch("builtins.open", mock.mock_open(read_data=b'file content'), side_effect=FileNotFoundError): | ||
config = main.Config() | ||
|
||
print(config.file) | ||
pass |