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

Make little changes #255

Closed
blakeNaccarato opened this issue Dec 7, 2022 · 74 comments
Closed

Make little changes #255

blakeNaccarato opened this issue Dec 7, 2022 · 74 comments
Labels
enhancement New feature or request

Comments

@blakeNaccarato
Copy link
Member

blakeNaccarato commented Dec 7, 2022

EDIT: Leaving this open until last bits are complete. But it is getting bloated with checkboxes so new changes should be posted in #338.

This is a long-lived issue that will track little changes to be made to the template. Changes tracked here are not usually big enough for their own PR, so they can be batched with each other in occasional sprints.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 7, 2022

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 7, 2022

  • Migrate launch.json to initializer template
  • Migrate tasks.json to initializer template

@blakeNaccarato blakeNaccarato pinned this issue Dec 7, 2022
@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 8, 2022

  • Add bare pre-commit task above the pre-commit run --all-files
    {
      "label": "pre-commit",
      "type": "process",
      "command": "pwsh",
      "args": ["-Command", "pre-commit"],
      "problemMatcher": []
    },

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 8, 2022

  • Add stage all task
    {
      "label": "git: Stage all files",
      "type": "process",
      "command": "git",
      "args": ["add", "-A"],
      "problemMatcher": []
    },

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 9, 2022

  • Standardize all tasks to use pwsh then Command in args

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 10, 2022

  • Latest VSCode update, exclude venv from auto expanding files when stepping in

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 13, 2022

  • Actually add latest pre-commit hooks from boilerdata. Forgot to?

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 20, 2022

  • Use .markdownlint.yaml as in boilerdata with MD013 and MD041: false instead of VSCode settings
  • Wrap all version numbers in double-quotes in pre-commit config
  • Figure out why markdownlint-cli or markdownlint-cli2 aren't working as pre-commit hooks.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 21, 2022

  • Change docs/index.md to look like this
```{include} ../README.md
:relative-docs: docs/
:relative-images:
```

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Dec 27, 2022

  • Add "git-submodules": { "enabled": true }, to renovate.json.
  • Move the first-time-only submodule addition step to a task executed by copier-python-init. Migrate those things out of setup.ps1 and update.ps1 and figure out a way for users to only pull the repo-approved version of typings.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Update copier-python-init with latest copier.yaml changes and more

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Make sure submodule add is forced if necessary due to typings being gitignored

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Remove git project manager from extension recommendations

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Make templated test pass CI by making sure to use that import, over in copier-python-init.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Make bump template digest... message more meaningful, indicating that the template is also being bumped.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Change copier-python-init to inform the template from the submodule rather than the repo pull. Then add submodules pull action back to the workflow over in copier-python. This will be a cleaner, single source of truth solution.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Resolve weird thing where .gitmodules has a duplicate template entry added

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 2, 2023

  • Consider removing pull_request event from main.yml.jinja and see if that fixes the change detection always returning true when bumping template. If so, then !failure() can be brought back

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 3, 2023

  • Add copier -f -r $(git rev-parse HEAD:template) task

@blakeNaccarato blakeNaccarato changed the title Propagate changes back to this template Make little changes Jan 3, 2023
@blakeNaccarato blakeNaccarato added the enhancement New feature or request label Jan 3, 2023
@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 4, 2023

  • Template renovate.json on override_precommit to delegate pre-commit updates to the project repo

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 4, 2023

  • Add ./requirements.txt to the cache

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 26, 2023

  • Make bump.yml work on push to all branches.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 28, 2023

  • Switch bump.yml back to main only. Otherwise it blocks automerge.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Jan 30, 2023

  • Conditionally run Remove-Item -Recurse -Force .venv in setup.ps1 only if .venv exists

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 3, 2023

  • Try Invoke-Expression or & instead of . in setup.ps1

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 3, 2023

  • Remove cicd_setup.sh from template initializer

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 3, 2023

  • Use explicit -- parameters in all Tasks and other automations.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 4, 2023

  • Propagate the below warning suppression

See #319 (comment)

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 4, 2023

  • Prepend PYTHONWARNINGS multiple times in environment file

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 5, 2023

  • Leave explicit comment-fenced regions for PROJECT-SPECIFIC input from the user in most template/user-shared files to facilitate diffs

This is definitely needed. Extra .env keys keep getting clobbered because of this

Looks like

# * -------------------------------------------------------------------------------- * #
# * PROJECT-SPECIFIC
# * Bla bla bla bla bla

# * -------------------------------------------------------------------------------- * #
# * TEMPLATE-SPECIFIC
# * Bla bla bla bla bla

@blakeNaccarato blakeNaccarato unpinned this issue Mar 5, 2023
@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 5, 2023

  • Filter this warning
C:\Users\naccara5\.local\pipx\venvs\copier\Lib\site-packages\plumbum\commands\base.py:207: ResourceWarning: unclosed file <_io.BufferedRandom name='C:\\Users\\naccara5\\AppData\\Local\\Temp\\tmpmtnoac7j'>
  p = self.popen(args, **kwargs)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 6, 2023

  • Run ruff using NbQA against notebooks on save

https://github.com/nbQA-dev/nbQA

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 6, 2023

  • Have bump_precommit upgrade requirements*.txt when matching packages are bumped. Like with ruff

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 6, 2023

  • Run NbQA in pre-commit, but be sure to bump sub-deps manually like we do with blacken.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 6, 2023

- [ ] Introduce the all-contributors automation like nbQA has

https://github.com/nbQA-dev

MIGRATED

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 7, 2023

  • Try checking out the commit pushed by the dependent workflow No longer necessary.

In this example, a specific ref is checked out. Can we just supply the commit as an output of the bump job? Would need to be conditional on bumping.

- uses: actions/checkout@v3
  with:
    ref: ${{ github.event.pull_request.head.sha }}

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 7, 2023

  • Establish Renovate schedules, alternating between copier-python and derived repositories.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 7, 2023

  • Create Task to just re-run the template copy operation, allowing for different answers

copier -r "$(git rev-parse HEAD:template)"

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 7, 2023

  • Add fences to pre-commit-config.yaml, setup.ps1, and update.ps1

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 8, 2023

  • Exclude frozen_requirements.txt from dependency bumping
  • Fix the excluded dependencies for pre-commit-config.yaml not working

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 8, 2023

  • Template Python version in this file

https://github.com/blakeNaccarato/copier-python/blob/main/template/.sourcery.yaml.jinja#L7

  • Stop templating pre-commit-config.yaml and pyrightconfig.json

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 8, 2023

  • Propagate warnings to pytest.ini

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 8, 2023

  • Don't warn on unnecessary type ignores in CI

This would decouple the back-and-forth

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 8, 2023

  • Add an action to re-update the template on the current commit, without bumping. Don't copy, update.

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 9, 2023

  • Add task to re-compose pyproject.toml

@blakeNaccarato
Copy link
Member Author

  • Use importlib import mode for pytest

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 10, 2023

  • Use built-in black[jupyter] support over nbqa

https://github.com/psf/black#installation

@blakeNaccarato
Copy link
Member Author

blakeNaccarato commented Mar 11, 2023

  • Look into Frontmatter extension

@blakeNaccarato
Copy link
Member Author

All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant