diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7c0eb71..b5ad23ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -204,7 +204,7 @@ jobs: needs: - build - - test-linux + # - test-linux - test-windows steps: - uses: actions/checkout@v3 @@ -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 diff --git a/src/towncrier/_writer.py b/src/towncrier/_writer.py index 65f571ea..6beb36e4 100644 --- a/src/towncrier/_writer.py +++ b/src/towncrier/_writer.py @@ -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) @@ -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): """ diff --git a/src/towncrier/test/test_build.py b/src/towncrier/test/test_build.py index 5e9dadc7..3973657f 100644 --- a/src/towncrier/test/test_build.py +++ b/src/towncrier/test/test_build.py @@ -795,7 +795,7 @@ 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: @@ -803,6 +803,7 @@ def test_bullet_points_false(self): 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, [ @@ -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, """