GeospatialPython / pyshp

This library reads and writes ESRI Shapefiles in pure Python.
MIT License
1.09k stars 259 forks source link

Find a better url to a zipped shapefile. Replace the current url on Github with a url external to Github, to guarantee test integrity. #273

Open JamesParrott opened 1 month ago

JamesParrott commented 1 month ago

Describe the feature request

The new URL should replace the one in the code here:

https://github.com/GeospatialPython/pyshp/blob/daab62f87fb5578fbd9aaf487d59a135212cad40/test_shapefile.py#L278

and in the read me here:

https://github.com/GeospatialPython/pyshp/blob/daab62f87fb5578fbd9aaf487d59a135212cad40/README.md?plain=1#L302

The zip file should contain one shapefile only, and pass the following tests:

    with shapefile.Reader(url) as sf:
        for recShape in sf.iterShapeRecords():
            pass
        assert len(sf) > 0
    assert sf.shp.closed == sf.shx.closed == sf.dbf.closed == True
sf = shapefile.Reader("https://github.com/JamesParrott/PyShp_test_shapefile/raw/main/gis_osm_natural_a_free_1.zip")

The REPL snippets within Readme.md are run as doctests in CI. These alongwith the Pytest tests can be run in CI, by making a fork, by enabling Github Actions on it, appending /pyshp/actions/workflows/build.yml to the fork's url, and clicking the Run workflow button (select the branch containing the changes to be tested).

Contributions