Skip to content

Commit

Permalink
Merge pull request #269 from JamesParrott/PyShp-test-on-Pythons-3.10-…
Browse files Browse the repository at this point in the history
…3.13

Test Pyshp in CI in Python 3.10, 3.11, 3.12 and 3.13 containers.
  • Loading branch information
GeospatialPython authored Jan 20, 2024
2 parents d3b6e2a + d3c5834 commit ce1ff22
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ on:
jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9"]
python-version: ["2.7.18", "3.5.10", "3.6.15", "3.7.17", "3.8.18", "3.9.18", "3.10.13", "3.11.7", "3.12.1", "3.13.0a2"]

runs-on: ubuntu-latest
container:
image: python:${{ matrix.python-version }}-slim

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ build/
dist/
*.egg-info/
*.py[cod]
.vscode
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1082,13 +1082,15 @@ A .prj file, or projection file, is a simple text file that stores a shapefile's

If you're using the same projection over and over, the following is a simple way to create the .prj file assuming your base filename is stored in a variable called "filename":

>>> with open("{}.prj".format(filename), "w") as prj:
>>> wkt = 'GEOGCS["WGS 84",'
>>> wkt += 'DATUM["WGS_1984",'
>>> wkt += 'SPHEROID["WGS 84",6378137,298.257223563]]'
>>> wkt += ',PRIMEM["Greenwich",0],'
>>> wkt += 'UNIT["degree",0.0174532925199433]]'
>>> prj.write(wkt)
```
with open("{}.prj".format(filename), "w") as prj:
wkt = 'GEOGCS["WGS 84",'
wkt += 'DATUM["WGS_1984",'
wkt += 'SPHEROID["WGS 84",6378137,298.257223563]]'
wkt += ',PRIMEM["Greenwich",0],'
wkt += 'UNIT["degree",0.0174532925199433]]'
prj.write(wkt)
```

If you need to dynamically fetch WKT projection strings, you can use the pure Python [PyCRS](https://github.com/karimbahgat/PyCRS) module which has a number of useful features.

Expand Down
2 changes: 1 addition & 1 deletion requirements.test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==3.2.5
pytest
setuptools

0 comments on commit ce1ff22

Please sign in to comment.