Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration script fixes #138

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ To compare dist files with a reference checkout, run the following:
python -m hatch_jupyter_builder.compare_migration <source_dir> <target_dir> sdist
```

The migration scripts can also be used without installation, using `pipx`, e.g.:

```bash
pipx hatch_jupyter_builder migrate .
```

Use `wheel` to compare wheel file contents.

See the [documentation for more information on migration](https://hatch-jupyter-builder.readthedocs.io/en/latest/source/how_to_guides/index.html) for more details.
Expand Down
5 changes: 3 additions & 2 deletions hatch_jupyter_builder/migrate/_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
# Move flake8 config to separate file, preserving comments.
# Add .flake8 file to git.
setup_cfg = Path("setup.cfg")
flake8_path = Path(".flake8")
flake8 = ["[flake8]"]
if setup_cfg.exists():
lines = setup_cfg.read_text("utf-8").splitlines()
Expand All @@ -97,8 +98,8 @@
flake8.append(line)

if matches:
Path(".flake8").write_text("\n".join(flake8) + "\n", "utf-8")
subprocess.run(["git", "add", ".flake"], check=False)
flake8_path.write_text("\n".join(flake8) + "\n", "utf-8")
subprocess.run(["git", "add", str(flake8_path)], check=False)


# Migrate and remove unused config.
Expand Down