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

Git repository initialization for just init #1

Open
ZamboniMarco99 opened this issue Jul 25, 2023 · 7 comments
Open

Git repository initialization for just init #1

ZamboniMarco99 opened this issue Jul 25, 2023 · 7 comments

Comments

@ZamboniMarco99
Copy link

install rule expect the project to be a git repository.

Error message:

An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
Check the log at /Users/marco/.cache/pre-commit/pre-commit.log
error: Recipe `install` failed with exit code 1

config rule expect a git remote to be configured

Error message:

error: No such remote 'origin'
 (y/n): y
/var/folders/53/k45zpdwx48b6vclybwb7jby00000gn/T/justp3lI8o/ensure-repo:189: not an identifier: A repo with this name already exists. Do you want to add it as a remote
error: Recipe `ensure-repo` failed with exit code 1
error: Recipe `config` failed with exit code 1

Possible fixes:

  1. document and ask the user to do it: something like adding git init && git remote add origin your-repo in the readme before the just init step
  2. Let just perform those command (it is even indicated in this comment). The justfile at the root of this repo does something like this
@ZamboniMarco99 ZamboniMarco99 changed the title Git repository initialization Git repository initialization for just init Jul 25, 2023
@baggiponte
Copy link
Owner

Ciao Marco, thanks for spotting this!

Let just perform those command (it is even indicated in this comment). The justfile at the root of this repo does something like this

Indeed, I had that included but not execute in the cookiecutter's justfile. This should have been fixed with a3830a2, would you fancy trying if it works?

@baggiponte
Copy link
Owner

@ZamboniMarco99 sorry for the ping, would you mind checking if this works so I can close the issue? 😊

@ZamboniMarco99
Copy link
Author

@baggiponte just init creates the local repository correctly, but just install (which, if I understood correctly, is an alternative if I don't want the github CI) still doesn't.

Also, just init fails later as there is a bug in the pre-commit configuration file where the hook for mypy doesn't have a name:

Installing pre-commit hooks...
pre-commit installed at .git/hooks/pre-commit
An error has occurred: InvalidConfigError: 
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='local')
==> At key: hooks
==> At Hook(id='mypy')
=====> Missing required key: name
Check the log at /Users/marco/.cache/pre-commit/pre-commit.log
error: Recipe `install` failed on line 16 with exit code 1

@baggiponte
Copy link
Owner

Also, just init fails later as there is a bug in the pre-commit configuration file where the hook for mypy doesn't have a name

Oh yes this is being addressed in #5. I will look into just install. I did not think of that as an alternative to CI, but a way to install all packages an pre-commit hooks. It should be a "development-oriented" setup.

@ZamboniMarco99
Copy link
Author

I did not think of that as an alternative to CI, but a way to install all packages an pre-commit hooks. It should be a "development-oriented" setup.

I was reading the README that says:

Install all default dependencies and setup the GitHub secrets to run the CI/CD pipelines, run the following just recipe:
just init
For this command to execute successfully, you need to have pdm and the GitHub CLI installed.

This recipe will set three GitHub secrets:

PDM_PUBLISH_REPO: the URL to publish your package to.
PDM_PUBLISH_USERNAME: the username of the account used to publish the package.
PDM_PUBLISH_PASSWORD: the authentication token.
f you do not want to configure CI/CD on GitHub, you can simply run the following:

just install
This will only install the dev dependencies.

@baggiponte
Copy link
Owner

OH lol I might have removed that. Thanks for spotting that out, will need to fix that too.

@baggiponte
Copy link
Owner

Reported as well. Thanks.

Repository owner deleted a comment from technosoft-admin Jan 28, 2024
Repository owner deleted a comment from technosoft-admin Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants