From 86e2b259dd9e11826fc41e45d34f3b63b90e391d Mon Sep 17 00:00:00 2001 From: David Bitner Date: Thu, 21 Sep 2023 14:27:40 -0500 Subject: [PATCH] fix bugs with staging version, update for v0.8.0 release --- .pre-commit-config.yaml | 7 ------- CHANGELOG.md | 4 ++-- docker/pypgstac/bin/stageversion | 2 +- ...gstac.0.7.10-unreleased.sql => pgstac.0.7.10-0.8.0.sql} | 2 +- .../migrations/{pgstac.unreleased.sql => pgstac.0.8.0.sql} | 2 +- src/pgstac/pgstac.sql | 2 +- src/pgstac/sql/999_version.sql | 2 +- src/pypgstac/pyproject.toml | 2 +- src/pypgstac/python/pypgstac/version.py | 2 +- src/pypgstac/tests/hydration/test_dehydrate_pg.py | 3 ++- src/pypgstac/tests/hydration/test_hydrate_pg.py | 3 ++- 11 files changed, 13 insertions(+), 18 deletions(-) rename src/pgstac/migrations/{pgstac.0.7.10-unreleased.sql => pgstac.0.7.10-0.8.0.sql} (99%) rename src/pgstac/migrations/{pgstac.unreleased.sql => pgstac.0.8.0.sql} (99%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edb24b55..da4e1d67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,13 +35,6 @@ repos: verbose: true fail_fast: true files: Dockerfile$|\.rs$ - - id: stageversion - name: stageversion - entry: scripts/stageversion - language: script - pass_filenames: false - verbose: true - fail_fast: true - id: sql name: sql entry: scripts/test diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd128b1..d6ebc351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [unreleased] +## [v0.8.0] ### Fixed @@ -384,7 +384,7 @@ _TODO_ - Fixed issue with pypgstac loads which caused some writes to fail ([#18](https://github.com/stac-utils/pgstac/pull/18)) -[unreleased]: https://github.com/stac-utils/pgstac/compare/v0.7.10...HEAD +[v0.8.0]: https://github.com/stac-utils/pgstac/compare/v0.7.10...v0.8.0 [v0.7.10]: https://github.com/stac-utils/pgstac/compare/v0.7.9...v0.7.10 [v0.7.9]: https://github.com/stac-utils/pgstac/compare/v0.7.8...v0.7.9 [v0.7.8]: https://github.com/stac-utils/pgstac/compare/v0.7.7...v0.7.8 diff --git a/docker/pypgstac/bin/stageversion b/docker/pypgstac/bin/stageversion index 3f89d452..0547d41d 100755 --- a/docker/pypgstac/bin/stageversion +++ b/docker/pypgstac/bin/stageversion @@ -49,6 +49,6 @@ cat < $PYPGSTACDIR/python/pypgstac/version.py """Version.""" __version__ = "${PYVERSION}" EOD -sed -i "s/^version[ ]*=[ ]*.*/version = \"${PYVERSION}\"/" $PYPGSTACDIR/pyproject.toml +sed -i "s/^version[ ]*=[ ]*.*$/version = \"${PYVERSION}\"/" $PYPGSTACDIR/pyproject.toml makemigration -f $OLDVERSION -t $VERSION diff --git a/src/pgstac/migrations/pgstac.0.7.10-unreleased.sql b/src/pgstac/migrations/pgstac.0.7.10-0.8.0.sql similarity index 99% rename from src/pgstac/migrations/pgstac.0.7.10-unreleased.sql rename to src/pgstac/migrations/pgstac.0.7.10-0.8.0.sql index a8bcb2a8..fd52087d 100644 --- a/src/pgstac/migrations/pgstac.0.7.10-unreleased.sql +++ b/src/pgstac/migrations/pgstac.0.7.10-0.8.0.sql @@ -487,4 +487,4 @@ GRANT ALL ON ALL TABLES IN SCHEMA pgstac to pgstac_ingest; GRANT USAGE ON ALL SEQUENCES IN SCHEMA pgstac to pgstac_ingest; SELECT update_partition_stats_q(partition) FROM partitions_view; -SELECT set_version('unreleased'); +SELECT set_version('0.8.0'); diff --git a/src/pgstac/migrations/pgstac.unreleased.sql b/src/pgstac/migrations/pgstac.0.8.0.sql similarity index 99% rename from src/pgstac/migrations/pgstac.unreleased.sql rename to src/pgstac/migrations/pgstac.0.8.0.sql index c29ce198..aa7070a8 100644 --- a/src/pgstac/migrations/pgstac.unreleased.sql +++ b/src/pgstac/migrations/pgstac.0.8.0.sql @@ -4100,4 +4100,4 @@ GRANT ALL ON ALL TABLES IN SCHEMA pgstac to pgstac_ingest; GRANT USAGE ON ALL SEQUENCES IN SCHEMA pgstac to pgstac_ingest; SELECT update_partition_stats_q(partition) FROM partitions_view; -SELECT set_version('unreleased'); +SELECT set_version('0.8.0'); diff --git a/src/pgstac/pgstac.sql b/src/pgstac/pgstac.sql index 27b50f0f..a8b553a4 120000 --- a/src/pgstac/pgstac.sql +++ b/src/pgstac/pgstac.sql @@ -1 +1 @@ -migrations/pgstac.unreleased.sql \ No newline at end of file +migrations/pgstac.0.8.0.sql \ No newline at end of file diff --git a/src/pgstac/sql/999_version.sql b/src/pgstac/sql/999_version.sql index ecd86ef1..ef90b9b5 100644 --- a/src/pgstac/sql/999_version.sql +++ b/src/pgstac/sql/999_version.sql @@ -1 +1 @@ -SELECT set_version('unreleased'); +SELECT set_version('0.8.0'); diff --git a/src/pypgstac/pyproject.toml b/src/pypgstac/pyproject.toml index b8df1604..9be7faa6 100644 --- a/src/pypgstac/pyproject.toml +++ b/src/pypgstac/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pypgstac" -version = "0.7.10-dev" +version = "0.8.0" description = "Schema, functions and a python library for storing and accessing STAC collections and items in PostgreSQL" readme = "README.md" requires-python = ">=3.8" diff --git a/src/pypgstac/python/pypgstac/version.py b/src/pypgstac/python/pypgstac/version.py index 0471548c..3691f20b 100644 --- a/src/pypgstac/python/pypgstac/version.py +++ b/src/pypgstac/python/pypgstac/version.py @@ -1,2 +1,2 @@ """Version.""" -__version__ = "0.7.10-dev" +__version__ = "0.8.0" diff --git a/src/pypgstac/tests/hydration/test_dehydrate_pg.py b/src/pypgstac/tests/hydration/test_dehydrate_pg.py index 24b23a66..0734eead 100644 --- a/src/pypgstac/tests/hydration/test_dehydrate_pg.py +++ b/src/pypgstac/tests/hydration/test_dehydrate_pg.py @@ -26,7 +26,8 @@ def db(self) -> Generator: os.environ["PGDATABASE"] = "pgstactestdb" pgdb = PgstacDB() - pgdb.query("DROP SCHEMA IF EXISTS pgstac CASCADE;") + with psycopg.connect(autocommit=True) as conn: + conn.execute("DROP SCHEMA IF EXISTS pgstac CASCADE;") Migrate(pgdb).run_migration() yield pgdb diff --git a/src/pypgstac/tests/hydration/test_hydrate_pg.py b/src/pypgstac/tests/hydration/test_hydrate_pg.py index 1245e37a..22b9f7c6 100644 --- a/src/pypgstac/tests/hydration/test_hydrate_pg.py +++ b/src/pypgstac/tests/hydration/test_hydrate_pg.py @@ -27,7 +27,8 @@ def db(self) -> Generator[PgstacDB, None, None]: os.environ["PGDATABASE"] = "pgstactestdb" pgdb = PgstacDB() - pgdb.query("DROP SCHEMA IF EXISTS pgstac CASCADE;") + with psycopg.connect(autocommit=True) as conn: + conn.execute("DROP SCHEMA IF EXISTS pgstac CASCADE;") Migrate(pgdb).run_migration() yield pgdb