Skip to content

Add GitHub Actions for comprehensive testing and modernise packaging#85

Merged
ppannuto merged 37 commits into
ppannuto:mainfrom
brocksam:actions
Jul 1, 2021
Merged

Add GitHub Actions for comprehensive testing and modernise packaging#85
ppannuto merged 37 commits into
ppannuto:mainfrom
brocksam:actions

Conversation

@brocksam
Copy link
Copy Markdown
Contributor

@brocksam brocksam commented Jun 17, 2021

This PR improves the use of GitHub Actions by Titlecase and modernises the packaging of Titlecase.

Regarding GitHub Actions, this PR adds (or improves) the workflows:

  • test.py: try installing the package and run the tests on Ubuntu, macOS and Windows for the latest Python version (run on all pushes);
  • ci.py: try installing the package and run the tests on Ubuntu, macOS and Windows for all supported Python version (run only on pull requests);
  • coverage.yml: run the tests and update the coverage with Coveralls; and
  • publish.yml: automatically publish the package to PyPI when a new GitHub release is made (note that this only works correctly with versioning when the additional package modernisation changes are also made).

Regarding the package modernisation, this PR takes packaging recommendations inline with PEP 517/PEP 518, including:

  • using setup.cfg for package metadata;
  • adding a pyproject.toml file;
  • shrinking setup.py;
  • removing MANIFEST.in; and
  • use setuptools-scm for controlling the package versioning (which basically relies on the GitHub release tags - required in conjunction with publish.yml).

This PR also:

  • changes the license file type to .txt as it is plain text; and
  • removes the .travis.yml file as TravisCI seems to no longer work for this project.

Note to @ppannuto: for publish.yml to work, it is required that an API token for Titlecase on PyPI is created and added to this repository as a secret called "PYPI_TOKEN".

EDIT: an API token for Titlecase on Coveralls is also required. This must be added as a secret called "COVERALLS_TOKEN".

@brocksam
Copy link
Copy Markdown
Contributor Author

I have also removed Python 3.4 and 3.5 as their end of life dates were 18th March 2019 and 13th September 2020 respectively.

@brocksam
Copy link
Copy Markdown
Contributor Author

Waiting for further input from @fireundubh on issue #86 to try and resolve the test failures on Windows with Python 3.6 and 3.7 before this is taken further.

@brocksam brocksam changed the title WIP: Add GitHub Actions for comprehensive testing and modernise packaging Add GitHub Actions for comprehensive testing and modernise packaging Jun 17, 2021
@brocksam
Copy link
Copy Markdown
Contributor Author

This is ready to be merged (pending creation of the PyPI and Coveralls tokens as explained above) as I believe it will greatly help with the resolution of issue #86.

@brocksam
Copy link
Copy Markdown
Contributor Author

Recommendation from @fireundubh on issue #86 implemented in e7ca9fb. All tests now passing on Windows for all supported Python versions.

I suggest rerunning the coverage.yml workflow once the suggested tokens have been created and added to this repo as secrets before merging the PR to ensure that it's working correctly. Assuming that that is successful, this PR is now good to go.

Comment thread titlecase/tests.py Outdated
ppannuto added 2 commits June 28, 2021 13:26
I don't really use github releases since they don't store their metadata in git. I do make tags and push those to the repo, which seems to auto-generate some sense of a release in the github UX, but I think these two things will conflict, so dropping this workflow.
Comment thread .github/workflows/coverage.yml Outdated
Comment thread .github/workflows/coverage.yml Outdated
Comment thread .github/workflows/coverage.yml Outdated
@ppannuto
Copy link
Copy Markdown
Owner

Why is this so hard to configure coveralls? WIP status, got something uploading, but it seems to be an empty job: https://coveralls.io/jobs/82790913

@brocksam
Copy link
Copy Markdown
Contributor Author

Sorry @ppannuto, I don't think I can help more specifically with the Coveralls stuff and I've not used it before. I only made the GitHub Actions workflow for it so that we could fully transfer over from Travis CI and did so just by using the Coveralls workflow docs.

@ppannuto
Copy link
Copy Markdown
Owner

No worries; maybe the answer is to abandon coveralls and move to something that more easily integrates with GH actions. I'm not attached to coveralls at all, just want something that generates a coverage report. Will try to look around lunchtime for a solution hopefully.

Trying a new service
... the important things
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 1, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@edaaec4). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  Coverage        ?   79.06%           
=======================================
  Files           ?        2           
  Lines           ?      215           
  Branches        ?        0           
=======================================
  Hits            ?      170           
  Misses          ?       45           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update edaaec4...300cf5e. Read the comment docs.

@ppannuto ppannuto merged commit 930b0ae into ppannuto:main Jul 1, 2021
ppannuto added a commit that referenced this pull request Jul 1, 2021
*Really* fix re/regex, fix older Py+Windows, and major CI overhaul

 - #85: GitHub Actions for comprehensive testing and modernise packaging (**enormous** thank you to @brocksam and @fireundubh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants