An executable to check if any packages installed with the host's package manager can be installed as a snap package.
The project is tracked using a git-subtree. To push changes upstream,
git subtree push --prefix subtrees/snapify [email protected]:jmelahman/python-snapify.git master
See also, github://jmelahman/python-snapify.
A python client for Bazel.
The project is tracked using a git-subtree. To push changes upstream,
git subtree push --prefix subtrees/pybazel [email protected]:jmelahman/pybazel.git master
See also, github://jmelahman/pybazel.
Provides a blueprint print a buildkite pipeline.
The project is tracked using a git-subtree. To push changes upstream,
git subtree push --prefix subtrees/buildprint [email protected]:jmelahman/buildprint.git master
See also, github://jmelahman/buildprint.
Python dependencies are specified in third_party/requirements.in
and compiled to
third_party/requirements.txt
.
To recompile third_party/requirements.txt
, run,
bazel run //third_party:requirements.update
To upgrade all dependencies (dangerous),
bazel run //third_party:requirements.update -- --upgrade
To upgrade a single dependency (in this case, the mypy
package),
bazel run //third_party:requirements.update -- --upgrade-package mypy
Mypy is a static-type checker and linter for python. There are three ways to run mypy:
- standalone mypy
- as a mypy daemon
- as a bazel asepct
The preferred method is as a bazel aspect, but using a daemon or standalone might be more performant or convenient depending on the workflow.
For either 1. or 2., you'll first have to install the build and runtime dependencies for the repo,
pip install -r tools/typing/mypy-requirements.txt
pip install -r third_party/requirements.txt
If using the mypy daemon, you'll then need to start it with the correct config,
dmypy start -- --config-file=tools/typing/mypy.ini
Then either:
mypy --config-file=tools/typing/mypy.ini
Tip: if you copy this tools/typing/.mypy.ini
to ~/.mypy.ini
, you don't need to pass the flag in either case.
or
dmypy check .
Note: dmypy check
must run from the toplevel of the repo unless you explicitly handle the status file.
Note: With mypy
and dmypy
, mypy will use the local packages (monorepo/pybazel
) rather than those installed in the site-packages whereas the oppisite is true for the bazel aspect.
To use the bazel aspect,
bazel build --config=mypy //...
Tip: This also supports ibazel
.
These packages are compiled with mypyc, so .pyi
files are required for consumers to be able to reference the type hints.
These files are generated automatically using stubgen
.
For example, to generate type stubs for the pybazel
package, run,
stubgen pybazel --out subtrees/pybazel/
Formatting python is done by black.
To run the formatter,
bazel run //tools/format
or alternatively,
bazel build @pypi__310__black_22_12_0//:bin-black
bazel-bin/external/pypi__310__black_22_12_0/bin-black .
Formatting bazel BUILD
and .bzl
is done by Buildifier.
To run the formatter,
bazel run //:buildifier
and verify with,
bazel run //:buildifier.check