Comments (1)
Hi @webb-ben
I've been looking into this and, while I do think it would be generally a good idea to have pygeoapi dependencies be pinned, in this particular case I believe the better solution is for us to simply update the pygeoapi tests - and have the discussion about dependency pinning some other time 😉
Looking at startlette's release notes, the only relevant change that concerns this pygeoapi CI breakage seems to be the mention to a change to the starlette test client.
The failing pygeoapi tests are using a configuration that features:
# snippet of pygeoapi/tests/pygeoapi-test-config-apirules.yml
server:
url: http://localhost:5000/api
# rest of config omitted for brevity
api_rules:
strict_slashes: true
url_prefix: 'v{api_major}'
version_header: 'X-API-Version'
This causes the pygeoapi tests to initialize a starlette TestClient
by providing it a base URL of http://localhost:5000/api
, which is the cause of the problem.
The server.url
config value is supposed to be pygeoapi's public URL, but the pygeoapi web application is always served at the root path (i.e. /
).
This means that when the public URL is modified with some additional path, as in the testing case, there must be some additional entity (usually a proxying web server) which takes care of reading the original URL (http://localhost:5000/api/v0/
and strip away the subpath before passing it down to pygeoapi, which only understands http://localhost:5000/v0/
(note the lack of the /api
, sub-path).
The starlette test client, not being a proxy web server, is not able to perform such sub-path stripping. Therefore, the pygeoapi initialization of the test client should not be passing it the server's public base URL. I believe the reason why this was working before the recent change in starlette was due to this issue:
Which is what motivated the starlette change.
So in conclusion, the fix for this specific problem boils down to not passing a base_url
when initializing the startlette test client - I am able to submit a PR with it shortly.
from pygeoapi.
Related Issues (20)
- Parameter 'outputs' from request object is not propagated to the manager execute_process and then to processor execute HOT 7
- Error generating JSON-LD of an item without geometry
- Example section in PROCESS_METADATA is mandatory HOT 1
- Make numpy a first-level dependency
- some test fixtures that use openapi are passed a callable instead of a fixture
- `parameter-names` need to change to `parameter_names` in EDR implementation HOT 1
- Connection PyGeoAPI STAC from QGIS?
- Missing documentation for BaseProcessor.execute() HOT 2
- Implementation of a reference EchoProcess
- expose shapely functions as sample process HOT 2
- BaseManager.execute_process fails if connection is not defined HOT 2
- logs don't have error information HOT 1
- Refactor the MVT Provider Class HOT 1
- move all examples into separate GitHub repository HOT 6
- Abstract Tile Matrix Set Metadata format from MVT Provider
- Refactor Tiles Metadata UI to support multiple formats HOT 1
- Address TMS Requirements Class of the Tile Specification HOT 1
- Documentation inadequate for starlette deployment
- pygeoapi not returning a proper TMS definition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygeoapi.