Commit Graph

11 Commits

Author SHA1 Message Date
RumovZ
a5ad95ca41
Fix Rust Analyzer recommendation (#1878) 2022-05-18 13:40:10 +10:00
Damien Elmes
e025f2f879 Only organize Python imports automatically
It's causing changes that aren't reproduced/picked up by prettier:

https://github.com/ankitects/anki/pull/1862#discussion_r870395750
2022-05-13 13:44:48 +10:00
RumovZ
890b28c1e8
Fix undisruptive formatting issues (#1848)
* Skip unparsable pylib files with black

This was causing black to return a non-zero code, preventing the
subsequent isort from running.

* Organise imports on save
2022-05-09 20:00:20 +10:00
Damien Elmes
b8ce480f61 Don't warn about missing .py files in VS Code
Our _pb2.py files are available at runtime, and we only need the .pyi
files for editing.
2022-03-07 11:54:41 +10:00
Damien Elmes
cf247a9053 add some more suggested VS Code extensions 2022-02-18 11:33:54 +10:00
Damien Elmes
9bac5b4cb6 disable automatic mypy invocation in VS Code
The default settings don't understand our folder layout (leading to
errors), and place cache files in the root folder. While there is a
setting to provide extra arguments to mypy which we could use to address
the former, paths like ~/.cache do not appear to be supported. Easier
to just rely on pyright for in-IDE linting, and invoke mypy either
via bazel, or via tools/mypy-watch

+ remove unused dist/ exclude
2022-02-17 13:25:22 +10:00
Damien Elmes
95dbf30fb9 updates to the build process and binary bundles
All platforms:

- rename scripts/ to tools/: Bazelisk expects to find its wrapper script
(used by the Mac changes below) in tools/. Rather than have a separate
scripts/ and tools/, it's simpler to just move everything into tools/.
- wheel outputs and binary bundles now go into .bazel/out/dist. While
not technically Bazel build products, doing it this way ensures they get
cleaned up when 'bazel clean' is run, and it keeps them out of the source
folder.
- update to the latest Bazel

Windows changes:

- bazel.bat has been removed, and tools\setup-env.bat has been added.
Other scripts like .\run.bat will automatically call it to set up the
environment.
- because Bazel is now on the path, you can 'bazel test ...' from any
folder, instead of having to do \anki\bazel.
- the bat files can handle being called from any working directory,
so things like running "\anki\tools\python" from c:\ will work.
- build installer as part of bundling process

Mac changes:

- `arch -arch x86_64 bazel ...` will now automatically use a different
build root, so that it is cheap to switch back and forth between archs
on a new Mac.
- tools/run-qt* will now automatically use Rosetta
- disable jemalloc in Mac x86 build for now, as it won't build under
Rosetta (perhaps due to its build scripts using $host_cpu instead of
$target_cpu)
- create app bundle as part of bundling process

Linux changes:

- remove arm64 orjson workaround in Linux bundle, as without a
readily-available, relatively distro-agonstic PyQt/Qt build
we can use, the arm64 Linux bundle is of very limited usefulness.
- update Docker files for release build
- include fcitx5 in both the qt5 and qt6 bundles
- create tarballs as part of the bundling process
2022-02-10 19:23:07 +10:00
Damien Elmes
f842ab7c9d switch convenience symlinks to .bazel/
Unfortunately 5efaf5a4be broke the Svelte
language tools - presumably having paths outside of the repo is confusing
them.

As a plan B, the symlinks have been shifted to a single subdir. Along
with some exclusions in the VS Code config, this should allow VS Code
to continue to work out of the box, but the docs will need updating
to reflect the extra work required for PyCharm/IntelliJ.

+ fix svelte-check execution on a system without node installed. It
still throws up some errors that are presumably caused by our multiple
rootDirs - not sure if there's an easy way to work around that.
2022-01-24 11:06:02 +10:00
Damien Elmes
7e01335536 add some more VS Code workspace settings for Python/Rust 2022-01-23 19:18:46 +10:00
Damien Elmes
6a5939a035 recommend some modules in VS Code 2022-01-23 19:18:46 +10:00
Damien Elmes
6b6d0b0820 add vscode conf so pylib imports resolve in aqt by default 2022-01-21 21:50:53 +10:00