Skip to content

CI: consolidate the build scripts and github actions tests workflow#1241

Merged
jorisvandenbossche merged 24 commits intoshapely:mainfrom
jorisvandenbossche:consolidate-actions-tests
Dec 5, 2021
Merged

CI: consolidate the build scripts and github actions tests workflow#1241
jorisvandenbossche merged 24 commits intoshapely:mainfrom
jorisvandenbossche:consolidate-actions-tests

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
Member

@jorisvandenbossche jorisvandenbossche commented Dec 1, 2021

xref #962

This PR consolidates the github actions workflow for tests + the build scripts required for that, and gets the tests "passing":

  • I basically used the pygeos workflow and build scripts (with some minor adjustments for shapely), but kept the name of the shapely files. So as a result the diff actually shows the difference with the original shapely files.
  • Also removed appveyor file because this is now covered by github actions
  • I still added some skips, and temporarily disabled warning checking and doctests (all are marked with a TODO(shapely-2.0) comment), to get the tests CI green here (we can fix those in targeted follow-ups, but for those follow-ups a green CI will be useful)

@jorisvandenbossche jorisvandenbossche changed the title CI: consolidate the github actions tests workflow CI: consolidate the build scripts and github actions tests workflow Dec 1, 2021
Copy link
Copy Markdown
Collaborator

@caspervdw caspervdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nitpicks, for the rest there is one test failing on python 3.10, something with a deprecation warning on setting attributes. OK if you want to postpone solving that. Maybe good to decorate those with shapely20_todo so that we can start working with a green CI.

run: |
python -c "from shapely import geos; print(geos.geos_version_string)"
python -m pytest --cov shapely --cov-report term-missing
pytest shapely/tests -cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pytest shapely/tests -cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}
pytest tests shapely/tests -cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}

And drop the next line.



# TODO(shapely-2.0)
@pytest.mark.xfail(strict=False, reason="Not yet implemented for Shapely 2.0")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use shapely20_todo here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I initially did, but that one is currently a "strict" xfail, and this test also seemed to pass in some builds (it might depend on the GEOS version, in any case something to verify and clean-up in a follow-up).
I could also make the general marker less strict, but the strict version is also nice because then you get notified if something starts passing.

return []
return InteriorRingSequence(self)

def __eq__(self, other):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an oversight in #1239 where I removed the other __eq__ methods

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 3, 2021

Coverage Status

Coverage remained the same at 81.131% when pulling 0c70f61 on jorisvandenbossche:consolidate-actions-tests into 1bc638d on Toblerity:main.

run: |
python -c "from shapely import geos; print(geos.geos_version_string)"
python -m pytest --cov shapely --cov-report term-missing
pytest shapely/tests tests -cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pytest shapely/tests tests -cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}
pytest shapely/tests tests --cov shapely --cov-report term-missing ${{ matrix.extra_pytest_args }}

maybe you can also include the coverage stuff in the “extra_pytest_args” so that the coverage report is only generated on a specific run?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks :)

maybe you can also include the coverage stuff in the “extra_pytest_args” so that the coverage report is only generated on a specific run?

I think it can actually be useful to run coverage on multiple builds (and the coverage report should then get combined), to run cover code that is version specific as well (although most of the GEOS-version specific code lives in C, and that's not covered by this anyway)

Co-authored-by: Casper van der Wel <caspervdw@gmail.com>
@caspervdw
Copy link
Copy Markdown
Collaborator

caspervdw commented Dec 3, 2021

There is one issue with coverage also reporting test coverage on the tests in shapely/tests themselves.

According to the docs , pytest-cov needs this in the .coveragerc:

[run]
source = shapely
omit = shapely/tests/* 

@caspervdw
Copy link
Copy Markdown
Collaborator

Btw I am mostly not using coverage in my projects, because I think it gives a false sense of confidence. So I am actually 👍 on dropping it all together

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

Yeah, I personally also don't use coverage that much (it's mostly because it was present, that I kept it). I think as long as you are aware of the limitations and don't use it as indication that "all is good", it can have some use (if something is not covered, that's still useful information)

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

Test workflows are all passing here, so going to merge this so have proper CI running again.

@jorisvandenbossche jorisvandenbossche merged commit a0f8a31 into shapely:main Dec 5, 2021
@jorisvandenbossche jorisvandenbossche deleted the consolidate-actions-tests branch December 5, 2021 13:00
@caspervdw
Copy link
Copy Markdown
Collaborator

Good! Are you planning to look into the wheelbuild workflows? I could do that maybe in the coming days.

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

Are you planning to look into the wheelbuild workflows?

Didn't plan yet, so feel free to do so! (I think it should be only a minor edit, for example at least updating the test invocation to run shapely tests, but maybe not much more, since the GEOS build scripts are already updated in this PR)

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.

3 participants