diff --git a/.bazeliskrc b/.bazeliskrc deleted file mode 100644 index afe0b46..0000000 --- a/.bazeliskrc +++ /dev/null @@ -1 +0,0 @@ -USE_BAZEL_VERSION=6.2.0 diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..66ce77b --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +7.0.0 diff --git a/projects/activitypub_relay/src/python/relay/__init__.py b/projects/activitypub_relay/src/relay/__init__.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/__init__.py rename to projects/activitypub_relay/src/relay/__init__.py diff --git a/projects/activitypub_relay/src/python/relay/__main__.py b/projects/activitypub_relay/src/relay/__main__.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/__main__.py rename to projects/activitypub_relay/src/relay/__main__.py diff --git a/projects/activitypub_relay/src/python/relay/application.py b/projects/activitypub_relay/src/relay/application.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/application.py rename to projects/activitypub_relay/src/relay/application.py diff --git a/projects/activitypub_relay/src/python/relay/config.py b/projects/activitypub_relay/src/relay/config.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/config.py rename to projects/activitypub_relay/src/relay/config.py diff --git a/projects/activitypub_relay/src/python/relay/database.py b/projects/activitypub_relay/src/relay/database.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/database.py rename to projects/activitypub_relay/src/relay/database.py diff --git a/projects/activitypub_relay/src/python/relay/http_debug.py b/projects/activitypub_relay/src/relay/http_debug.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/http_debug.py rename to projects/activitypub_relay/src/relay/http_debug.py diff --git a/projects/activitypub_relay/src/python/relay/misc.py b/projects/activitypub_relay/src/relay/misc.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/misc.py rename to projects/activitypub_relay/src/relay/misc.py diff --git a/projects/activitypub_relay/src/python/relay/processors.py b/projects/activitypub_relay/src/relay/processors.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/processors.py rename to projects/activitypub_relay/src/relay/processors.py diff --git a/projects/activitypub_relay/src/python/relay/views.py b/projects/activitypub_relay/src/relay/views.py similarity index 100% rename from projects/activitypub_relay/src/python/relay/views.py rename to projects/activitypub_relay/src/relay/views.py diff --git a/projects/aloe/src/python/aloe/__main__.py b/projects/aloe/src/aloe/__main__.py similarity index 100% rename from projects/aloe/src/python/aloe/__main__.py rename to projects/aloe/src/aloe/__main__.py diff --git a/projects/aloe/src/python/aloe/cursedlogger.py b/projects/aloe/src/aloe/cursedlogger.py similarity index 100% rename from projects/aloe/src/python/aloe/cursedlogger.py rename to projects/aloe/src/aloe/cursedlogger.py diff --git a/projects/aloe/src/python/aloe/icmp.py b/projects/aloe/src/aloe/icmp.py similarity index 100% rename from projects/aloe/src/python/aloe/icmp.py rename to projects/aloe/src/aloe/icmp.py diff --git a/projects/anosql-migrations/src/python/anosql_migrations.py b/projects/anosql-migrations/src/anosql_migrations.py similarity index 100% rename from projects/anosql-migrations/src/python/anosql_migrations.py rename to projects/anosql-migrations/src/anosql_migrations.py diff --git a/projects/anosql-migrations/test/python/test_migrations.py b/projects/anosql-migrations/test/test_migrations.py similarity index 100% rename from projects/anosql-migrations/test/python/test_migrations.py rename to projects/anosql-migrations/test/test_migrations.py diff --git a/projects/anosql/src/python/anosql/__init__.py b/projects/anosql/src/anosql/__init__.py similarity index 100% rename from projects/anosql/src/python/anosql/__init__.py rename to projects/anosql/src/anosql/__init__.py diff --git a/projects/anosql/src/python/anosql/adapters/__init__.py b/projects/anosql/src/anosql/adapters/__init__.py similarity index 100% rename from projects/anosql/src/python/anosql/adapters/__init__.py rename to projects/anosql/src/anosql/adapters/__init__.py diff --git a/projects/anosql/src/python/anosql/adapters/psycopg2.py b/projects/anosql/src/anosql/adapters/psycopg2.py similarity index 100% rename from projects/anosql/src/python/anosql/adapters/psycopg2.py rename to projects/anosql/src/anosql/adapters/psycopg2.py diff --git a/projects/anosql/src/python/anosql/adapters/sqlite3.py b/projects/anosql/src/anosql/adapters/sqlite3.py similarity index 100% rename from projects/anosql/src/python/anosql/adapters/sqlite3.py rename to projects/anosql/src/anosql/adapters/sqlite3.py diff --git a/projects/anosql/src/python/anosql/core.py b/projects/anosql/src/anosql/core.py similarity index 100% rename from projects/anosql/src/python/anosql/core.py rename to projects/anosql/src/anosql/core.py diff --git a/projects/anosql/src/python/anosql/exceptions.py b/projects/anosql/src/anosql/exceptions.py similarity index 100% rename from projects/anosql/src/python/anosql/exceptions.py rename to projects/anosql/src/anosql/exceptions.py diff --git a/projects/anosql/src/python/anosql/patterns.py b/projects/anosql/src/anosql/patterns.py similarity index 100% rename from projects/anosql/src/python/anosql/patterns.py rename to projects/anosql/src/anosql/patterns.py diff --git a/projects/anosql/test/python/__init__.py b/projects/anosql/test/__init__.py similarity index 100% rename from projects/anosql/test/python/__init__.py rename to projects/anosql/test/__init__.py diff --git a/projects/anosql/test/python/blogdb/data/blogs_data.csv b/projects/anosql/test/blogdb/data/blogs_data.csv similarity index 100% rename from projects/anosql/test/python/blogdb/data/blogs_data.csv rename to projects/anosql/test/blogdb/data/blogs_data.csv diff --git a/projects/anosql/test/python/blogdb/data/users_data.csv b/projects/anosql/test/blogdb/data/users_data.csv similarity index 100% rename from projects/anosql/test/python/blogdb/data/users_data.csv rename to projects/anosql/test/blogdb/data/users_data.csv diff --git a/projects/anosql/test/python/blogdb/sql/blogs/blogs.sql b/projects/anosql/test/blogdb/sql/blogs/blogs.sql similarity index 100% rename from projects/anosql/test/python/blogdb/sql/blogs/blogs.sql rename to projects/anosql/test/blogdb/sql/blogs/blogs.sql diff --git a/projects/anosql/test/python/blogdb/sql/blogs/blogs_pg.sql b/projects/anosql/test/blogdb/sql/blogs/blogs_pg.sql similarity index 100% rename from projects/anosql/test/python/blogdb/sql/blogs/blogs_pg.sql rename to projects/anosql/test/blogdb/sql/blogs/blogs_pg.sql diff --git a/projects/anosql/test/python/blogdb/sql/blogs/blogs_sqlite.sql b/projects/anosql/test/blogdb/sql/blogs/blogs_sqlite.sql similarity index 100% rename from projects/anosql/test/python/blogdb/sql/blogs/blogs_sqlite.sql rename to projects/anosql/test/blogdb/sql/blogs/blogs_sqlite.sql diff --git a/projects/anosql/test/python/blogdb/sql/users/users.sql b/projects/anosql/test/blogdb/sql/users/users.sql similarity index 100% rename from projects/anosql/test/python/blogdb/sql/users/users.sql rename to projects/anosql/test/blogdb/sql/users/users.sql diff --git a/projects/anosql/test/python/conftest.py b/projects/anosql/test/conftest.py similarity index 100% rename from projects/anosql/test/python/conftest.py rename to projects/anosql/test/conftest.py diff --git a/projects/anosql/test/python/test_psycopg2.py b/projects/anosql/test/test_psycopg2.py similarity index 100% rename from projects/anosql/test/python/test_psycopg2.py rename to projects/anosql/test/test_psycopg2.py diff --git a/projects/anosql/test/python/test_simple.py b/projects/anosql/test/test_simple.py similarity index 100% rename from projects/anosql/test/python/test_simple.py rename to projects/anosql/test/test_simple.py diff --git a/projects/anosql/test/python/test_sqlite3.py b/projects/anosql/test/test_sqlite3.py similarity index 100% rename from projects/anosql/test/python/test_sqlite3.py rename to projects/anosql/test/test_sqlite3.py diff --git a/projects/async_cache/src/python/async_cache/__init__.py b/projects/async_cache/src/async_cache/__init__.py similarity index 100% rename from projects/async_cache/src/python/async_cache/__init__.py rename to projects/async_cache/src/async_cache/__init__.py diff --git a/projects/async_cache/src/python/async_cache/key.py b/projects/async_cache/src/async_cache/key.py similarity index 100% rename from projects/async_cache/src/python/async_cache/key.py rename to projects/async_cache/src/async_cache/key.py diff --git a/projects/async_cache/src/python/async_cache/lru.py b/projects/async_cache/src/async_cache/lru.py similarity index 100% rename from projects/async_cache/src/python/async_cache/lru.py rename to projects/async_cache/src/async_cache/lru.py diff --git a/projects/async_cache/src/python/async_cache/ttl.py b/projects/async_cache/src/async_cache/ttl.py similarity index 100% rename from projects/async_cache/src/python/async_cache/ttl.py rename to projects/async_cache/src/async_cache/ttl.py diff --git a/projects/async_cache/test/python/test_lru.py b/projects/async_cache/test/test_lru.py similarity index 100% rename from projects/async_cache/test/python/test_lru.py rename to projects/async_cache/test/test_lru.py diff --git a/projects/async_cache/test/python/test_ttl.py b/projects/async_cache/test/test_ttl.py similarity index 100% rename from projects/async_cache/test/python/test_ttl.py rename to projects/async_cache/test/test_ttl.py diff --git a/projects/bazelshim/BUILD.bazel b/projects/bazelshim/BUILD.bazel new file mode 100644 index 0000000..f5177f6 --- /dev/null +++ b/projects/bazelshim/BUILD.bazel @@ -0,0 +1,3 @@ +py_project( + name = "bazelshim", +) diff --git a/projects/bazelshim/src/bazelshim/__main__.py b/projects/bazelshim/src/bazelshim/__main__.py new file mode 100644 index 0000000..9cc9f21 --- /dev/null +++ b/projects/bazelshim/src/bazelshim/__main__.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 + +# A Bazel wrapper +# +# This script exists to allow for the setting of environment viariables and other context flags to Bazel on behalf of +# the user. Consequently it has some magical (partial) knowledge of Bazel's CLI options since it's really a CLI shim. + +import sys +from typing import List, Optional +from shlex import split as shlex +from dataclasses import dataclass + +VERBS = ["sync", "build", "aquery", "query", "cquery", "run", "test", "coverage", "dump", "fetch", "help", "info", "mod",] + +def normalize_opts(args: List[str]) -> List[str]: + acc = [] + + if args[0].endswith("bazel") or args[0].endswith("bazelis"): + acc.append(args.pop(0)) + + while len(args) >= 2: + if args[0] == "--": + # Break + acc.extend(args) + break + + elif args[0].contains("="): + # If it's a k/v form pass it through + acc.append(args.pop(0)) + + elif args[0].startswith("--no"): + # Convert --no args to --=no + acc.append("--" + args.pop(0).lstrip("--no") + "=false") + + elif args[0].startswith("--") and not args[1].startswith("--") and args[1] not in VERBS: + # If the next thing isn't an opt, assume it's a '--a b' form + acc.append(args[0] + "=" + args[1]) + args.pop(0) + args.pop(0) + + elif args[0].startswith("--"): + # Assume it's a boolean true flag + acc.append(args.pop(0) + "=true") + + elif args[0] in VERBS: + acc.append(args.pop(0)) + + else: + raise ValueError(repr(args)) + + return acc + +assert normalize_opts(shlex("bazel clean")) == ["bazel", "clean"] +assert normalize_opts(shlex("bazel --client_debug clean")) == ["bazel", "--client_debug=true", "clean"] +assert normalize_opts(shlex("bazel build //foo:bar //baz:*")) == ["bazel", "build", "//foo:bar", "//baz:*"] +assert normalize_opts(shlex("bazel test //foo:bar //baz:* -- -vvv")) == ["bazel", "test", "//foo:bar", "//baz:*", "--", "-vvv"] +assert normalize_opts(shlex("bazel run //foo:bar -- --foo=bar --baz=qux")) == ["bazel", "run", "//foo:bar", "--", "--foo=bar", "--baz=qux"] + +@dataclass +class BazelCli: + startup_opts: List[str] + command: Optional[str] + command_opts: List[str] + subprocess_opts: List[str] + + @classmethod + def parse_cli(cls, args: List[str]) -> BazelCLI: + pass diff --git a/projects/bussard/src/python/bussard/__init__.py b/projects/bussard/src/bussard/__init__.py similarity index 100% rename from projects/bussard/src/python/bussard/__init__.py rename to projects/bussard/src/bussard/__init__.py diff --git a/projects/bussard/src/python/bussard/bfmt b/projects/bussard/src/bussard/bfmt similarity index 100% rename from projects/bussard/src/python/bussard/bfmt rename to projects/bussard/src/bussard/bfmt diff --git a/projects/bussard/src/python/bussard/bparse b/projects/bussard/src/bussard/bparse similarity index 100% rename from projects/bussard/src/python/bussard/bparse rename to projects/bussard/src/bussard/bparse diff --git a/projects/bussard/src/python/bussard/gen/__init__.py b/projects/bussard/src/bussard/gen/__init__.py similarity index 100% rename from projects/bussard/src/python/bussard/gen/__init__.py rename to projects/bussard/src/bussard/gen/__init__.py diff --git a/projects/bussard/src/python/bussard/reader.py b/projects/bussard/src/bussard/reader.py similarity index 100% rename from projects/bussard/src/python/bussard/reader.py rename to projects/bussard/src/bussard/reader.py diff --git a/projects/bussard/test/python/bussard/test_reader.py b/projects/bussard/test/bussard/test_reader.py similarity index 100% rename from projects/bussard/test/python/bussard/test_reader.py rename to projects/bussard/test/bussard/test_reader.py diff --git a/projects/calf/src/python/calf/__init__.py b/projects/calf/src/calf/__init__.py similarity index 100% rename from projects/calf/src/python/calf/__init__.py rename to projects/calf/src/calf/__init__.py diff --git a/projects/calf/src/python/calf/analyzer.py b/projects/calf/src/calf/analyzer.py similarity index 100% rename from projects/calf/src/python/calf/analyzer.py rename to projects/calf/src/calf/analyzer.py diff --git a/projects/calf/src/python/calf/cursedrepl.py b/projects/calf/src/calf/cursedrepl.py similarity index 100% rename from projects/calf/src/python/calf/cursedrepl.py rename to projects/calf/src/calf/cursedrepl.py diff --git a/projects/calf/src/python/calf/grammar.py b/projects/calf/src/calf/grammar.py similarity index 100% rename from projects/calf/src/python/calf/grammar.py rename to projects/calf/src/calf/grammar.py diff --git a/projects/calf/src/python/calf/io/reader.py b/projects/calf/src/calf/io/reader.py similarity index 100% rename from projects/calf/src/python/calf/io/reader.py rename to projects/calf/src/calf/io/reader.py diff --git a/projects/calf/src/python/calf/lexer.py b/projects/calf/src/calf/lexer.py similarity index 100% rename from projects/calf/src/python/calf/lexer.py rename to projects/calf/src/calf/lexer.py diff --git a/projects/calf/src/python/calf/packages.py b/projects/calf/src/calf/packages.py similarity index 100% rename from projects/calf/src/python/calf/packages.py rename to projects/calf/src/calf/packages.py diff --git a/projects/calf/src/python/calf/parser.py b/projects/calf/src/calf/parser.py similarity index 100% rename from projects/calf/src/python/calf/parser.py rename to projects/calf/src/calf/parser.py diff --git a/projects/calf/src/python/calf/reader.py b/projects/calf/src/calf/reader.py similarity index 100% rename from projects/calf/src/python/calf/reader.py rename to projects/calf/src/calf/reader.py diff --git a/projects/calf/src/python/calf/token.py b/projects/calf/src/calf/token.py similarity index 100% rename from projects/calf/src/python/calf/token.py rename to projects/calf/src/calf/token.py diff --git a/projects/calf/src/python/calf/types.py b/projects/calf/src/calf/types.py similarity index 100% rename from projects/calf/src/python/calf/types.py rename to projects/calf/src/calf/types.py diff --git a/projects/calf/src/python/calf/util.py b/projects/calf/src/calf/util.py similarity index 100% rename from projects/calf/src/python/calf/util.py rename to projects/calf/src/calf/util.py diff --git a/projects/cherry-shim/src/python/cherry_shim.py b/projects/cherry-shim/src/cherry_shim.py similarity index 100% rename from projects/cherry-shim/src/python/cherry_shim.py rename to projects/cherry-shim/src/cherry_shim.py diff --git a/projects/clusterctrl/src/python/clusterctrl/__main__.py b/projects/clusterctrl/src/clusterctrl/__main__.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/__main__.py rename to projects/clusterctrl/src/clusterctrl/__main__.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/alert.py b/projects/clusterctrl/src/clusterctrl/cmd/alert.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/alert.py rename to projects/clusterctrl/src/clusterctrl/cmd/alert.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/fan.py b/projects/clusterctrl/src/clusterctrl/cmd/fan.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/fan.py rename to projects/clusterctrl/src/clusterctrl/cmd/fan.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/hub.py b/projects/clusterctrl/src/clusterctrl/cmd/hub.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/hub.py rename to projects/clusterctrl/src/clusterctrl/cmd/hub.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/led.py b/projects/clusterctrl/src/clusterctrl/cmd/led.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/led.py rename to projects/clusterctrl/src/clusterctrl/cmd/led.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/power.py b/projects/clusterctrl/src/clusterctrl/cmd/power.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/power.py rename to projects/clusterctrl/src/clusterctrl/cmd/power.py diff --git a/projects/clusterctrl/src/python/clusterctrl/cmd/save.py b/projects/clusterctrl/src/clusterctrl/cmd/save.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/cmd/save.py rename to projects/clusterctrl/src/clusterctrl/cmd/save.py diff --git a/projects/clusterctrl/src/python/clusterctrl/driver.py b/projects/clusterctrl/src/clusterctrl/driver.py similarity index 100% rename from projects/clusterctrl/src/python/clusterctrl/driver.py rename to projects/clusterctrl/src/clusterctrl/driver.py diff --git a/projects/clusterctrl/test/python/test_driver.py b/projects/clusterctrl/test/test_driver.py similarity index 100% rename from projects/clusterctrl/test/python/test_driver.py rename to projects/clusterctrl/test/test_driver.py diff --git a/projects/damm/src/python/damm.py b/projects/damm/src/damm.py similarity index 100% rename from projects/damm/src/python/damm.py rename to projects/damm/src/damm.py diff --git a/projects/damm/test/python/test_damm.py b/projects/damm/test/test_damm.py similarity index 100% rename from projects/damm/test/python/test_damm.py rename to projects/damm/test/test_damm.py diff --git a/projects/damm/test/python/test_hypothesis.py b/projects/damm/test/test_hypothesis.py similarity index 100% rename from projects/damm/test/python/test_hypothesis.py rename to projects/damm/test/test_hypothesis.py diff --git a/projects/datalog-shell/src/python/datalog/shell/__main__.py b/projects/datalog-shell/src/datalog/shell/__main__.py similarity index 100% rename from projects/datalog-shell/src/python/datalog/shell/__main__.py rename to projects/datalog-shell/src/datalog/shell/__main__.py diff --git a/projects/datalog/src/python/__init__.py b/projects/datalog/src/__init__.py similarity index 100% rename from projects/datalog/src/python/__init__.py rename to projects/datalog/src/__init__.py diff --git a/projects/datalog/src/python/datalog/__init__.py b/projects/datalog/src/datalog/__init__.py similarity index 100% rename from projects/datalog/src/python/datalog/__init__.py rename to projects/datalog/src/datalog/__init__.py diff --git a/projects/datalog/src/python/datalog/debris.py b/projects/datalog/src/datalog/debris.py similarity index 100% rename from projects/datalog/src/python/datalog/debris.py rename to projects/datalog/src/datalog/debris.py diff --git a/projects/datalog/src/python/datalog/easy.py b/projects/datalog/src/datalog/easy.py similarity index 100% rename from projects/datalog/src/python/datalog/easy.py rename to projects/datalog/src/datalog/easy.py diff --git a/projects/datalog/src/python/datalog/evaluator.py b/projects/datalog/src/datalog/evaluator.py similarity index 100% rename from projects/datalog/src/python/datalog/evaluator.py rename to projects/datalog/src/datalog/evaluator.py diff --git a/projects/datalog/src/python/datalog/parser.py b/projects/datalog/src/datalog/parser.py similarity index 100% rename from projects/datalog/src/python/datalog/parser.py rename to projects/datalog/src/datalog/parser.py diff --git a/projects/datalog/src/python/datalog/reader.py b/projects/datalog/src/datalog/reader.py similarity index 100% rename from projects/datalog/src/python/datalog/reader.py rename to projects/datalog/src/datalog/reader.py diff --git a/projects/datalog/src/python/datalog/types.py b/projects/datalog/src/datalog/types.py similarity index 100% rename from projects/datalog/src/python/datalog/types.py rename to projects/datalog/src/datalog/types.py diff --git a/projects/datalog/test/python/test_datalog_evaluator.py b/projects/datalog/test/test_datalog_evaluator.py similarity index 100% rename from projects/datalog/test/python/test_datalog_evaluator.py rename to projects/datalog/test/test_datalog_evaluator.py diff --git a/projects/datalog/test/python/test_datalog_reader.py b/projects/datalog/test/test_datalog_reader.py similarity index 100% rename from projects/datalog/test/python/test_datalog_reader.py rename to projects/datalog/test/test_datalog_reader.py diff --git a/projects/flowmetal/src/python/flowmetal/__main__.py b/projects/flowmetal/src/flowmetal/__main__.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/__main__.py rename to projects/flowmetal/src/flowmetal/__main__.py diff --git a/projects/flowmetal/src/python/flowmetal/db/base.py b/projects/flowmetal/src/flowmetal/db/base.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/db/base.py rename to projects/flowmetal/src/flowmetal/db/base.py diff --git a/projects/flowmetal/src/python/flowmetal/db/redis.py b/projects/flowmetal/src/flowmetal/db/redis.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/db/redis.py rename to projects/flowmetal/src/flowmetal/db/redis.py diff --git a/projects/flowmetal/src/python/flowmetal/frontend.py b/projects/flowmetal/src/flowmetal/frontend.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/frontend.py rename to projects/flowmetal/src/flowmetal/frontend.py diff --git a/projects/flowmetal/src/python/flowmetal/interpreter.py b/projects/flowmetal/src/flowmetal/interpreter.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/interpreter.py rename to projects/flowmetal/src/flowmetal/interpreter.py diff --git a/projects/flowmetal/src/python/flowmetal/models.py b/projects/flowmetal/src/flowmetal/models.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/models.py rename to projects/flowmetal/src/flowmetal/models.py diff --git a/projects/flowmetal/src/python/flowmetal/reaper.py b/projects/flowmetal/src/flowmetal/reaper.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/reaper.py rename to projects/flowmetal/src/flowmetal/reaper.py diff --git a/projects/flowmetal/src/python/flowmetal/scheduler.py b/projects/flowmetal/src/flowmetal/scheduler.py similarity index 100% rename from projects/flowmetal/src/python/flowmetal/scheduler.py rename to projects/flowmetal/src/flowmetal/scheduler.py diff --git a/projects/gandi/src/python/gandi/__init__.py b/projects/gandi/src/gandi/__init__.py similarity index 100% rename from projects/gandi/src/python/gandi/__init__.py rename to projects/gandi/src/gandi/__init__.py diff --git a/projects/gandi/src/python/gandi/client.py b/projects/gandi/src/gandi/client.py similarity index 100% rename from projects/gandi/src/python/gandi/client.py rename to projects/gandi/src/gandi/client.py diff --git a/projects/gcode-interpreter/src/python/gcode_interpreter.py b/projects/gcode-interpreter/src/gcode_interpreter.py similarity index 100% rename from projects/gcode-interpreter/src/python/gcode_interpreter.py rename to projects/gcode-interpreter/src/gcode_interpreter.py diff --git a/projects/gh-unnotifier/src/python/ghunnotif/__main__.py b/projects/gh-unnotifier/src/ghunnotif/__main__.py similarity index 100% rename from projects/gh-unnotifier/src/python/ghunnotif/__main__.py rename to projects/gh-unnotifier/src/ghunnotif/__main__.py diff --git a/projects/jobq/src/python/jobq/__init__.py b/projects/jobq/src/jobq/__init__.py similarity index 100% rename from projects/jobq/src/python/jobq/__init__.py rename to projects/jobq/src/jobq/__init__.py diff --git a/projects/jobq/test/python/test_jobq.py b/projects/jobq/test/test_jobq.py similarity index 100% rename from projects/jobq/test/python/test_jobq.py rename to projects/jobq/test/test_jobq.py diff --git a/projects/jobqd/src/python/jobqd/__main__.py b/projects/jobqd/src/jobqd/__main__.py similarity index 100% rename from projects/jobqd/src/python/jobqd/__main__.py rename to projects/jobqd/src/jobqd/__main__.py diff --git a/projects/jobqd/src/python/jobqd/openapi.yaml b/projects/jobqd/src/jobqd/openapi.yaml similarity index 100% rename from projects/jobqd/src/python/jobqd/openapi.yaml rename to projects/jobqd/src/jobqd/openapi.yaml diff --git a/projects/jobqd/src/python/jobqd/rest/api.py b/projects/jobqd/src/jobqd/rest/api.py similarity index 100% rename from projects/jobqd/src/python/jobqd/rest/api.py rename to projects/jobqd/src/jobqd/rest/api.py diff --git a/projects/lilith/test/python/conftest.py b/projects/lilith/test/conftest.py similarity index 100% rename from projects/lilith/test/python/conftest.py rename to projects/lilith/test/conftest.py diff --git a/projects/lilith/test/python/test_interpreter.py b/projects/lilith/test/test_interpreter.py similarity index 100% rename from projects/lilith/test/python/test_interpreter.py rename to projects/lilith/test/test_interpreter.py diff --git a/projects/lilith/test/python/test_parser.py b/projects/lilith/test/test_parser.py similarity index 100% rename from projects/lilith/test/python/test_parser.py rename to projects/lilith/test/test_parser.py diff --git a/projects/lilith/test/python/test_reader.py b/projects/lilith/test/test_reader.py similarity index 100% rename from projects/lilith/test/python/test_reader.py rename to projects/lilith/test/test_reader.py diff --git a/projects/proquint/src/python/proquint/__init__.py b/projects/proquint/src/proquint/__init__.py similarity index 100% rename from projects/proquint/src/python/proquint/__init__.py rename to projects/proquint/src/proquint/__init__.py diff --git a/projects/proquint/src/python/proquint/__main__.py b/projects/proquint/src/proquint/__main__.py similarity index 100% rename from projects/proquint/src/python/proquint/__main__.py rename to projects/proquint/src/proquint/__main__.py diff --git a/projects/proquint/test/python/test_examples.py b/projects/proquint/test/test_examples.py similarity index 100% rename from projects/proquint/test/python/test_examples.py rename to projects/proquint/test/test_examples.py diff --git a/projects/proquint/test/python/test_hypothesis.py b/projects/proquint/test/test_hypothesis.py similarity index 100% rename from projects/proquint/test/python/test_hypothesis.py rename to projects/proquint/test/test_hypothesis.py diff --git a/projects/public_dns/src/python/updater/__init__.py b/projects/public_dns/src/updater/__init__.py similarity index 100% rename from projects/public_dns/src/python/updater/__init__.py rename to projects/public_dns/src/updater/__init__.py diff --git a/projects/public_dns/src/python/updater/__main__.py b/projects/public_dns/src/updater/__main__.py similarity index 100% rename from projects/public_dns/src/python/updater/__main__.py rename to projects/public_dns/src/updater/__main__.py diff --git a/projects/public_dns/test/python/test_parsing.py b/projects/public_dns/test/test_parsing.py similarity index 100% rename from projects/public_dns/test/python/test_parsing.py rename to projects/public_dns/test/test_parsing.py diff --git a/projects/ratchet/src/python/ratchet/__init__.py b/projects/ratchet/src/ratchet/__init__.py similarity index 100% rename from projects/ratchet/src/python/ratchet/__init__.py rename to projects/ratchet/src/ratchet/__init__.py diff --git a/projects/ratchet/src/python/ratchet/backend/sqlite.py b/projects/ratchet/src/ratchet/backend/sqlite.py similarity index 100% rename from projects/ratchet/src/python/ratchet/backend/sqlite.py rename to projects/ratchet/src/ratchet/backend/sqlite.py diff --git a/projects/reqman/src/python/reqman/__main__.py b/projects/reqman/src/reqman/__main__.py similarity index 100% rename from projects/reqman/src/python/reqman/__main__.py rename to projects/reqman/src/reqman/__main__.py diff --git a/projects/shoggoth/src/python/ichor/NOTES.md b/projects/shoggoth/src/ichor/NOTES.md similarity index 100% rename from projects/shoggoth/src/python/ichor/NOTES.md rename to projects/shoggoth/src/ichor/NOTES.md diff --git a/projects/shoggoth/src/python/ichor/__init__.py b/projects/shoggoth/src/ichor/__init__.py similarity index 100% rename from projects/shoggoth/src/python/ichor/__init__.py rename to projects/shoggoth/src/ichor/__init__.py diff --git a/projects/shoggoth/src/python/ichor/__main__.py b/projects/shoggoth/src/ichor/__main__.py similarity index 100% rename from projects/shoggoth/src/python/ichor/__main__.py rename to projects/shoggoth/src/ichor/__main__.py diff --git a/projects/shoggoth/src/python/ichor/assembler.py b/projects/shoggoth/src/ichor/assembler.py similarity index 100% rename from projects/shoggoth/src/python/ichor/assembler.py rename to projects/shoggoth/src/ichor/assembler.py diff --git a/projects/shoggoth/src/python/ichor/bootstrap.py b/projects/shoggoth/src/ichor/bootstrap.py similarity index 100% rename from projects/shoggoth/src/python/ichor/bootstrap.py rename to projects/shoggoth/src/ichor/bootstrap.py diff --git a/projects/shoggoth/src/python/ichor/interpreter.py b/projects/shoggoth/src/ichor/interpreter.py similarity index 100% rename from projects/shoggoth/src/python/ichor/interpreter.py rename to projects/shoggoth/src/ichor/interpreter.py diff --git a/projects/shoggoth/src/python/ichor/isa.py b/projects/shoggoth/src/ichor/isa.py similarity index 100% rename from projects/shoggoth/src/python/ichor/isa.py rename to projects/shoggoth/src/ichor/isa.py diff --git a/projects/shoggoth/src/python/ichor/state.py b/projects/shoggoth/src/ichor/state.py similarity index 100% rename from projects/shoggoth/src/python/ichor/state.py rename to projects/shoggoth/src/ichor/state.py diff --git a/projects/shoggoth/src/python/ichor/typing.py b/projects/shoggoth/src/ichor/typing.py similarity index 100% rename from projects/shoggoth/src/python/ichor/typing.py rename to projects/shoggoth/src/ichor/typing.py diff --git a/projects/shoggoth/src/python/shoggoth/analyzer.py b/projects/shoggoth/src/shoggoth/analyzer.py similarity index 100% rename from projects/shoggoth/src/python/shoggoth/analyzer.py rename to projects/shoggoth/src/shoggoth/analyzer.py diff --git a/projects/shoggoth/src/python/shoggoth/parser.py b/projects/shoggoth/src/shoggoth/parser.py similarity index 100% rename from projects/shoggoth/src/python/shoggoth/parser.py rename to projects/shoggoth/src/shoggoth/parser.py diff --git a/projects/shoggoth/src/python/shoggoth/reader.py b/projects/shoggoth/src/shoggoth/reader.py similarity index 100% rename from projects/shoggoth/src/python/shoggoth/reader.py rename to projects/shoggoth/src/shoggoth/reader.py diff --git a/projects/shoggoth/src/python/shoggoth/repl/__main__.py b/projects/shoggoth/src/shoggoth/repl/__main__.py similarity index 100% rename from projects/shoggoth/src/python/shoggoth/repl/__main__.py rename to projects/shoggoth/src/shoggoth/repl/__main__.py diff --git a/projects/shoggoth/src/python/shoggoth/types.py b/projects/shoggoth/src/shoggoth/types.py similarity index 100% rename from projects/shoggoth/src/python/shoggoth/types.py rename to projects/shoggoth/src/shoggoth/types.py diff --git a/projects/shoggoth/test/python/ichor/fixtures.py b/projects/shoggoth/test/ichor/fixtures.py similarity index 100% rename from projects/shoggoth/test/python/ichor/fixtures.py rename to projects/shoggoth/test/ichor/fixtures.py diff --git a/projects/shoggoth/test/python/ichor/test_assembler.py b/projects/shoggoth/test/ichor/test_assembler.py similarity index 100% rename from projects/shoggoth/test/python/ichor/test_assembler.py rename to projects/shoggoth/test/ichor/test_assembler.py diff --git a/projects/shoggoth/test/python/ichor/test_bootstrap.py b/projects/shoggoth/test/ichor/test_bootstrap.py similarity index 100% rename from projects/shoggoth/test/python/ichor/test_bootstrap.py rename to projects/shoggoth/test/ichor/test_bootstrap.py diff --git a/projects/shoggoth/test/python/ichor/test_interpreter.py b/projects/shoggoth/test/ichor/test_interpreter.py similarity index 100% rename from projects/shoggoth/test/python/ichor/test_interpreter.py rename to projects/shoggoth/test/ichor/test_interpreter.py diff --git a/projects/shoggoth/test/python/ichor/test_parsers.py b/projects/shoggoth/test/ichor/test_parsers.py similarity index 100% rename from projects/shoggoth/test/python/ichor/test_parsers.py rename to projects/shoggoth/test/ichor/test_parsers.py diff --git a/projects/shoggoth/test/python/ichor/test_state.py b/projects/shoggoth/test/ichor/test_state.py similarity index 100% rename from projects/shoggoth/test/python/ichor/test_state.py rename to projects/shoggoth/test/ichor/test_state.py diff --git a/projects/shoggoth/test/python/shogoth/test_parser.py b/projects/shoggoth/test/shogoth/test_parser.py similarity index 100% rename from projects/shoggoth/test/python/shogoth/test_parser.py rename to projects/shoggoth/test/shogoth/test_parser.py diff --git a/projects/smith/src/python/smith/__main__.py b/projects/smith/src/smith/__main__.py similarity index 100% rename from projects/smith/src/python/smith/__main__.py rename to projects/smith/src/smith/__main__.py diff --git a/projects/tentacles/test/python/conftest.py b/projects/tentacles/test/conftest.py similarity index 100% rename from projects/tentacles/test/python/conftest.py rename to projects/tentacles/test/conftest.py diff --git a/projects/tentacles/test/python/test_gcode.py b/projects/tentacles/test/test_gcode.py similarity index 100% rename from projects/tentacles/test/python/test_gcode.py rename to projects/tentacles/test/test_gcode.py diff --git a/projects/tentacles/test/python/test_store.py b/projects/tentacles/test/test_store.py similarity index 100% rename from projects/tentacles/test/python/test_store.py rename to projects/tentacles/test/test_store.py diff --git a/projects/tentacles/test/python/test_store_users.py b/projects/tentacles/test/test_store_users.py similarity index 100% rename from projects/tentacles/test/python/test_store_users.py rename to projects/tentacles/test/test_store_users.py diff --git a/projects/vfs/src/python/vfs/__init__.py b/projects/vfs/src/vfs/__init__.py similarity index 100% rename from projects/vfs/src/python/vfs/__init__.py rename to projects/vfs/src/vfs/__init__.py diff --git a/projects/vfs/src/python/vfs/impl.py b/projects/vfs/src/vfs/impl.py similarity index 100% rename from projects/vfs/src/python/vfs/impl.py rename to projects/vfs/src/vfs/impl.py diff --git a/projects/yamlschema/src/python/yamlschema/__init__.py b/projects/yamlschema/src/yamlschema/__init__.py similarity index 100% rename from projects/yamlschema/src/python/yamlschema/__init__.py rename to projects/yamlschema/src/yamlschema/__init__.py diff --git a/projects/yamlschema/test/python/test_yamlschema.py b/projects/yamlschema/test/test_yamlschema.py similarity index 100% rename from projects/yamlschema/test/python/test_yamlschema.py rename to projects/yamlschema/test/test_yamlschema.py diff --git a/tools/build_rules/prelude_bazel b/tools/build_rules/prelude_bazel index 97565b3..2b615ad 100644 --- a/tools/build_rules/prelude_bazel +++ b/tools/build_rules/prelude_bazel @@ -36,10 +36,3 @@ load("//tools/build_rules:webp.bzl", load("@rules_zapp//zapp:zapp.bzl", "zapp_binary", ) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", - "container_bundle", - "container_push", -) diff --git a/tools/python/BUILD.bazel b/tools/python/BUILD.bazel index 181f52e..860a229 100644 --- a/tools/python/BUILD.bazel +++ b/tools/python/BUILD.bazel @@ -40,8 +40,5 @@ py_pytest( srcs = [ "test_licenses.py", ], - data = [ - "requirements.txt", - ], deps = all_requirements, ) diff --git a/tools/python/defs.bzl b/tools/python/defs.bzl index 4e750bd..5c87d12 100644 --- a/tools/python/defs.bzl +++ b/tools/python/defs.bzl @@ -170,7 +170,7 @@ def py_project(name=None, """ A helper for defining conventionally-formatted python project. - Assumes that there's a {src,test}/{resources,python} where src/ is a library and test/ is local tests only. + Assumes that there's a {src,test}/ where src/ is a library and test/ is local tests only. Each test_*.py source generates its own implicit test target. This allows for automatic test parallelism. Non test_*.py files are implicitly srcs for the generated test targets. This is the same as making them implicitly a @@ -179,28 +179,26 @@ def py_project(name=None, """ lib_srcs = (lib_srcs or []) + \ - native.glob(["src/python/**/*.py"], + native.glob(["src/**/*.py"], exclude=[ "**/*.pyc", ]) lib_data = (lib_data or []) + \ - native.glob(["src/resources/**/*", - "src/python/**/*"], + native.glob(["src/**/*"], exclude=[ "**/*.py", "**/*.pyc", ]) test_srcs = (test_srcs or []) + \ - native.glob(["test/python/**/*.py"], + native.glob(["test/**/*.py"], exclude=[ "**/*.pyc", ]) test_data = (test_data or []) + \ - native.glob(["test/resources/**/*", - "test/python/**/*"], + native.glob(["test/**/*"], exclude=[ "**/*.py", "**/*.pyc", diff --git a/tools/python/test_licenses.py b/tools/python/test_licenses.py index 32e7246..32e9515 100644 --- a/tools/python/test_licenses.py +++ b/tools/python/test_licenses.py @@ -22,8 +22,11 @@ APPROVED_LICENSES = [ MPL20 := "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", PSFL := "License :: OSI Approved :: Python Software Foundation License", LGPL := "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", - LGPL3 := "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", + LGPL3 := 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', + LGPL3P := "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", ISCL := "License :: OSI Approved :: ISC License (ISCL)", + ZOPE := 'License :: OSI Approved :: Zope Public License', + PUBLIC := 'License :: Public Domain', ] UNAPPROVED_LICENSES = [ @@ -35,6 +38,7 @@ UNAPPROVED_LICENSES = [ # This data is GARBO. LICENSES_BY_LOWERNAME = { "apache 2.0": APACHE, + "apache 2": APACHE, "apache": APACHE, "http://www.apache.org/licenses/license-2.0": APACHE, "bsd 3": BSD, @@ -61,6 +65,8 @@ APPROVED_PACKAGES = [ "yamllint", # WARNING: YAMLLINT IS GLP3"d. "Flask_Log_Request_ID", # MIT, currently depended on as a git dep. "anosql", # BSD + "pathable", # Apache 2 + "proquint", # MIT ] @@ -126,7 +132,7 @@ def licenses(dist: DistInfoDistribution): if not lics: lics.append(license) - return lics + return [l.strip() for l in lics] @pytest.mark.parametrize(