sphinx-markdown-tables icon indicating copy to clipboard operation
sphinx-markdown-tables copied to clipboard

Add tests and validations

Open dwighthubbard opened this issue 5 years ago • 3 comments

This started as a change to fix the concrete makedocs==2.6.11 dependency in the setup.py install_requires setting. To fix #21

Since I was unsure if this requirement actually needed the specific version, I implemented tests and then made the changes. Letting the CI/CD pipeline verify that it still worked with the changes.

The CI Pipeline for this fork can be seen at: Build Status

The code coverage reporting for this fork is at: Code Coverage

The test package published by the CI pipeline to test.pypi.org is at: https://test.pypi.org/project/sphinx-markdown-tables/

The specifics of this changes are:

  • Added a .gitignore file to ignore the reports and cache files the test processes generate so they don't accidentally get committed to the repository.
  • Added a .pylintrc to ignore invalid issues that pylint raises due to the functions accepting arguments that aren't used but need to be there for a sphinx extension.
  • Added a PEP518 pyproject.toml file with the build requirements to ensure the version of setuptools is new enough to provide a working pkg_resources module.
  • Moved all the settings from the setup.py to the setup.cfg file.
  • Changes to the setup.cfg configuration
    • Incremented the middle digit of the version number to prevent the CI/CD version generation from generating an existing version number.
    • Added the README.md as the long description
    • Updated the install_requires, changed the markdown dependency to the abstract dependency markdown>=2.6.11 and added recommonmark because the tests where failing without it and setuptools>38.0.0 which is needed for the pkg_resources module that allows the package version to be read from the package metadata.
    • Added zip_safe = True
    • Added test extras_requires with the modules needed to run the tests.
  • Added a tox.ini to run the tests with multiple python versions as well as running pylint locally.
  • Added a screwdriver.yaml file to define the CI/CD pipeline.
  • Changed __init__.py to get the version from the package metadata using the pkg_resources module.

Note: My CI Pipeline has CODECOV_TOKEN and test pypi credentials in the CI Pipeline secrets which are needed to publish the code coverage to codecov and the test package to test.pypi.org.

dwighthubbard avatar Jul 10 '19 21:07 dwighthubbard

Hi Dwight, thanks for the PR. I think the tests are a good idea.

This is a pretty small package - the PR currently has more external dependencies than I would prefer. If this was reworked to limit that, I think it would be a good addition.

ryanfox avatar Sep 11 '19 18:09 ryanfox

Hi,

I'm using your pretty small package and it helps a lot: thanks! 👍

IMHO, this PR is a pretty good idea. I'm here today because the latest update (0.0.13) just broke my doc builds.

This is a pretty small package - the PR currently has more external dependencies than I would prefer. If this was reworked to limit that, I think it would be a good addition.

As far as dependencies are concerned, I don't see any more than in the original project:

install_requires =
    markdown>=2.6.11  --> well, you just upgraded it but not a big git conflict to solve here
    recommonmark        --> it should indeed be mentioned
    setuptools>38.0.0    --> even, still inuseful to set the minimum version

The most of added dependencies are for the tests and optional:

[options.extras_require]
test =
    pytest
    pytest-cov
    sphinx-testing

But, again, I think it could improve the package consistency and stability.

Guts avatar May 05 '20 05:05 Guts

Hi Guts, thanks. I think the issue was that I accidentally built v0.0.13 with some testing changes still active in my repo. I uploaded v0.0.14 - give it a try now.

The dependencies I was referring to were the things like pycharm and cobertura in .gitignore, and pylintrc, and tox, and screwdriver.

ryanfox avatar May 05 '20 05:05 ryanfox