diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fda49d6a0..94b7710f2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -191,7 +191,6 @@ jobs: fail-fast: false matrix: runs-on: - - macos-15-intel # x86_64-darwin - macos-14 # aarch64-darwin - ubuntu-24.04 # x86_64-linux - ubuntu-24.04-arm # aarch64-linux diff --git a/flake.lock b/flake.lock index 99eba90b2..7a9770da0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1782918843, - "narHash": "sha256-ETYnV9U7Sr+A45dohzZdfCZKOss4qrTkO+wgNZNvEc0=", + "lastModified": 1784115452, + "narHash": "sha256-BoYPdqk6jlKXy+DyUzyGV/CtRGfAhk2MmIgBhsemTGI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e8273b29fe1390ec8d4603f2477357555291432e", + "rev": "35d3407a3816f3b341d8cf1d60abaf2b7b8166ac", "type": "github" }, "original": { diff --git a/nix/tools/style.nix b/nix/tools/style.nix index 0fcd7f3c9..7a88e3ce6 100644 --- a/nix/tools/style.nix +++ b/nix/tools/style.nix @@ -21,6 +21,7 @@ let name = "postgrest-style"; docs = "Automatically format Haskell, Nix and Python files."; workingDir = "/"; + withTmpDir = true; } '' # Format Nix files @@ -32,7 +33,7 @@ let | xargs ${stylish-haskell}/bin/stylish-haskell -i # Format Python files - ${black}/bin/black . + TMPDIR="$tmpdir" ${black}/bin/black . ''; # Script to check whether any uncommitted changes result from postgrest-style diff --git a/test/io/config.py b/test/io/config.py index b31159e59..41e7459bd 100644 --- a/test/io/config.py +++ b/test/io/config.py @@ -4,7 +4,6 @@ import shutil import uuid import yaml - BASEDIR = pathlib.Path(os.path.realpath(__file__)).parent CONFIGSDIR = BASEDIR / "configs" FIXTURES = yaml.load( diff --git a/test/io/postgrest.py b/test/io/postgrest.py index 07e974393..54ee0922d 100644 --- a/test/io/postgrest.py +++ b/test/io/postgrest.py @@ -215,7 +215,7 @@ def run_pgproxy(env=None, proxy_timeout="1s"): ) if process.poll() is not None: - (_, stderr_output) = process.communicate(timeout=1) + _, stderr_output = process.communicate(timeout=1) raise RuntimeError( f"{NGINX_BIN} exited with {process.returncode}: {stderr_output}" ) diff --git a/test/io/test_cli.py b/test/io/test_cli.py index b700ce2d1..c378afcdf 100644 --- a/test/io/test_cli.py +++ b/test/io/test_cli.py @@ -62,7 +62,7 @@ def cli(args, env=None, stdin=None, expect_error=False): process.stdin.write(stdin or b"") try: - (stdout_output, stderr_output) = process.communicate(timeout=5) + stdout_output, stderr_output = process.communicate(timeout=5) if expect_error: # When expected to fail, return stderr, else stdout if process.returncode == 0: raise PostgrestError( @@ -310,7 +310,7 @@ def test_cli_ready_flag_success(host, defaultenv): with run(env=defaultenv, host=host, port=port, admin_port=admin_port) as postgrest: output = cli(["--ready"], env=postgrest.config) - (admin_host, admin_port) = get_admin_host_and_port_from_config(postgrest.config) + admin_host, admin_port = get_admin_host_and_port_from_config(postgrest.config) if is_ipv6(host): assert f"OK: http://[{admin_host}]:{admin_port}/ready" in output @@ -344,7 +344,7 @@ def test_cli_ready_flag_fail_when_schema_cache_not_loaded(defaultenv, metapostgr postgrest.wait_until_scache_starts_loading() output = cli(["--ready"], env=postgrest.config, expect_error=True) - (admin_host, admin_port) = get_admin_host_and_port_from_config(postgrest.config) + admin_host, admin_port = get_admin_host_and_port_from_config(postgrest.config) assert f"ERROR: http://{admin_host}:{admin_port}/ready" in output @@ -362,7 +362,7 @@ def test_cli_ready_flag_fail_with_http_exception(defaultenv): postgrest.config["PGRST_ADMIN_SERVER_PORT"] = str(freeport(used_ports)) output = cli(["--ready"], env=postgrest.config, expect_error=True) - (admin_host, admin_port) = get_admin_host_and_port_from_config(postgrest.config) + admin_host, admin_port = get_admin_host_and_port_from_config(postgrest.config) assert ( f"ERROR: connection refused to http://{admin_host}:{admin_port}/ready" @@ -373,7 +373,7 @@ def test_cli_ready_flag_fail_with_http_exception(defaultenv): with run(env=defaultenv, port=port, admin_port=admin_port) as postgrest: postgrest.config["PGRST_ADMIN_SERVER_PORT"] = str(-1) output = cli(["--ready"], env=postgrest.config, expect_error=True) - (admin_host, admin_port) = get_admin_host_and_port_from_config(postgrest.config) + admin_host, admin_port = get_admin_host_and_port_from_config(postgrest.config) assert f"ERROR: invalid url - http://{admin_host}:{admin_port}/ready" in output diff --git a/test/io/test_io.py b/test/io/test_io.py index 8a29a0f3e..8feaf0749 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -896,25 +896,21 @@ def test_stale_schema_cache_dropped_table_returns_database_error(defaultenv): } try: - psql_as_superuser( - """ + psql_as_superuser(""" drop table if exists stale_schema_cache_items; create table stale_schema_cache_items(id int primary key); insert into stale_schema_cache_items values (1); grant select on stale_schema_cache_items to postgrest_test_anonymous; - """ - ) + """) with run(env=env, wait_max_seconds=10) as postgrest: response = postgrest.session.get("/stale_schema_cache_items") assert response.status_code == 200 - psql_as_superuser( - """ + psql_as_superuser(""" drop table stale_schema_cache_items; notify pgrst, 'reload schema'; - """ - ) + """) response = postgrest.session.get("/stale_schema_cache_items") payload = response.json()