Skip to content

Commit

Permalink
chore/add replit object storage to guess (#295)
Browse files Browse the repository at this point in the history
* Reflow gen_pypi_map README

* Add replit.object-storage
  • Loading branch information
blast-hardcheese authored Oct 7, 2024
1 parent dd4c4b9 commit 983594e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
39 changes: 31 additions & 8 deletions internal/backends/python/gen_pypi_map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,39 @@ For example, to test the top 50000 packages:
go run ./gen_pypi_map/ test -threshold 50000
```

The test results for all tested packages will be stored in `pkgs.json` along with
the versions of the packages tested. `pkgs.json` is checked in to git. The command
will only test a packages if it's not already in the `pkgs.json` file or if
its latest version was not the one previously tested. If you
want to force a retest of the packages, you can use the `-force` flag.
... or, to just test a single package:

## Step 3: generate sqlite db
```bash
go run ./gen_pypi_map test-one -package replit-object-storage
```

NB: The command will only test a package if its version has not already been
tested. To force a rerun, please use `-force`.

Finally, we use the collected data to generate the lookup database. This is done with:
The results of each "test" run are stored in the directory,
specified by `-cache` (default: `./cache/`).

## Step 3: generate `pkgs.json`

Running the following command iterates over all "test" metadata accumulated in
`./cache/` and upserts that into `pkgs.json`. Commit all changes to `pkgs.json`

```bash
go run ./gen_pypi_map/ gen
go run ./gen_pypi_map updatepkgs
```

If you want to force a retest of the packages, you can use the `-force` flag.

## Step 4: generate sqlite db

Finally, we use the collected data to generate the lookup database. This is
done at upm-build time, since the resulting database should not be committed
into git.

You'll find that...

1. `nix/upm/default.nix` calls
2. `make internal/backends/python/pypi_map.sqlite` which calls
3. `go run ./gen_pypi_map/ gen`

You should only need to do this locally when testing.
1 change: 1 addition & 0 deletions internal/backends/python/pkgs.json
Original file line number Diff line number Diff line change
Expand Up @@ -16914,6 +16914,7 @@
{"name":"repl","downloads":{},"version":"1.0","modules":["repl"]}
{"name":"replicate","downloads":{},"version":"0.24.0","requires_dist":["httpx","packaging","pydantic","typing-extensions","pylint","pyright","pytest","pytest-asyncio","pytest-recording","respx","ruff"],"modules":["replicate"]}
{"name":"replit","downloads":{},"version":"3.6.1","requires_dist":["typing_extensions","Flask","Werkzeug","aiohttp","requests","pyseto","protobuf","urllib3","aiohttp-retry"],"modules":["replit"]}
{"name":"replit.object-storage","downloads":{},"version":"1.0.2","requires_dist":["google-cloud-storage","requests"],"modules":["replit.object_storage"]}
{"name":"repltalk","downloads":{},"version":"1.0.1","requires_dist":["aiohttp"],"modules":["repltalk"]}
{"name":"repo-helper","downloads":{},"version":"2022.4.4","requires_dist":["apeye","attrs","click","configconfig","consolekit","dict2css","dom-toml","domdf-python-tools","dulwich","first","isort","jinja2","mkrecipe","natsort","packaging","ruamel.yaml","shippinglabel","southwark","tabulate","typing-extensions","whey","yapf-isort","check-wheel-contents","coincidence","pytest","check-wheel-contents","coincidence","pytest"],"modules":["repo_helper"]}
{"name":"RepoDynamics","downloads":{},"version":"0.0.0.dev245","requires_dist":["packaging","pre-commit","markitup","jsonschema","pylinks","trove-classifiers","readme-renderer","ruamel.yaml","ruamel.yaml.string","tomlkit","pycolorit","pybadger","github-contexts"],"modules":["repodynamics"]}
Expand Down

0 comments on commit 983594e

Please sign in to comment.