Skip to content

Commit

Permalink
Let's do some print-in-ci debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Sep 3, 2022
1 parent 87492b7 commit b2026a9
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 60 deletions.
116 changes: 58 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,62 +50,62 @@ jobs:
name: dist
path: dist/

test-linux:
name: ${{ matrix.task.name}} - Linux ${{ matrix.python.name }}
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
python:
- name: CPython 3.7
tox: py37
action: 3.7
- name: CPython 3.8
tox: py38
action: 3.8
- name: CPython 3.9
tox: py39
action: 3.9
- name: CPython 3.10
tox: py310
action: '3.10'
- name: PyPy 3.7
tox: pypy37
action: pypy-3.7
- name: PyPy 3.8
tox: pypy38
action: pypy-3.8
task:
- name: Test
tox: tests

steps:
- uses: actions/checkout@v3

- name: Download package files
uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Set up ${{ matrix.python.name }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python.action }}

- name: Install dependencies
run: python -m pip install --upgrade pip tox codecov coverage[toml]

- uses: twisted/python-info-action@v1

- name: Tox
run: tox -c tox.ini --installpkg dist/*.whl -e ${{ matrix.python.tox }}-tests

- name: Codecov
run: |
codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"
# test-linux:
# name: ${{ matrix.task.name}} - Linux ${{ matrix.python.name }}
# runs-on: ubuntu-latest
# needs:
# - build
# strategy:
# fail-fast: false
# matrix:
# python:
# - name: CPython 3.7
# tox: py37
# action: 3.7
# - name: CPython 3.8
# tox: py38
# action: 3.8
# - name: CPython 3.9
# tox: py39
# action: 3.9
# - name: CPython 3.10
# tox: py310
# action: '3.10'
# - name: PyPy 3.7
# tox: pypy37
# action: pypy-3.7
# - name: PyPy 3.8
# tox: pypy38
# action: pypy-3.8
# task:
# - name: Test
# tox: tests

# steps:
# - uses: actions/checkout@v3

# - name: Download package files
# uses: actions/download-artifact@v3
# with:
# name: dist
# path: dist/

# - name: Set up ${{ matrix.python.name }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python.action }}

# - name: Install dependencies
# run: python -m pip install --upgrade pip tox codecov coverage[toml]

# - uses: twisted/python-info-action@v1

# - name: Tox
# run: tox -c tox.ini --installpkg dist/*.whl -e ${{ matrix.python.tox }}-tests

# - name: Codecov
# run: |
# codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"


test-windows:
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:

needs:
- build
- test-linux
# - test-linux
- test-windows
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
# This is the list of CI job that we are interested to be green before
# a merge.
- build
- test-linux
# - test-linux
- test-windows
- check
- pypi-publish
Expand Down
12 changes: 11 additions & 1 deletion src/towncrier/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ def append_to_newsfile(
if top_line and top_line in prev_body:
raise ValueError("It seems you've already produced newsfiles for this version?")

with open(news_file, "w", encoding="utf8") as f:
print("header", repr(header))
print("body", repr(prev_body))
print("new content", repr(content))

with open(news_file, "w", encoding="utf8", newline="") as f:
if header:
f.write(header)

Expand All @@ -40,6 +44,12 @@ def append_to_newsfile(
if prev_body:
f.write(f"\n\n{prev_body}")

with open(news_file, "rb") as f:
print("news bytes", repr(f.read()))

with open(news_file) as f:
print("news str", repr(f.read()))


def _figure_out_existing_content(news_file, start_string, single_file):
"""
Expand Down
5 changes: 4 additions & 1 deletion src/towncrier/test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,15 @@ def test_bullet_points_false(self):
)
os.mkdir("newsfragments")
with open("newsfragments/123.feature", "w") as f:
f.write("wow!\n" "~~~~\n" "\n" "No indentation at all.")
f.write("wow!\n~~~~\n\nNo indentation at all.")
with open("newsfragments/124.bugfix", "w") as f:
f.write("#. Numbered bullet list.")
with open("newsfragments/125.removal", "w") as f:
f.write("- Hyphen based bullet list.")
with open("newsfragments/126.doc", "w") as f:
f.write("* Asterisk based bullet list.")

print("frag", repr(read_all("newsfragments/123.feature")))
result = runner.invoke(
_main,
[
Expand All @@ -819,6 +820,8 @@ def test_bullet_points_false(self):
self.assertEqual(0, result.exit_code, result.output)
output = read_all("NEWS.rst")

print("test-out", result.output)

self.assertEqual(
output,
"""
Expand Down

0 comments on commit b2026a9

Please sign in to comment.