Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Requirements not found error + fix for error in black#6

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nmenardg-keeper wants to merge5 commits intomarian-code:master
base:master
Choose a base branch
Loading
fromnmenardg-keeper:requirements-not-found-error
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,27 +49,21 @@ steps:
python-version: "3.7"
```

### Examples
> :information_source: python-lint-annotate expects a `requirements.txt` file in your project.
> See example to generate one with `pipenv`.
> Leave an empty one if needed.

### More Examples
* [Only lint changed files, and ignore missing docstrings](examples/actions-only_changed_files.yml)
* [Install requirements from pipenv and lint all files](examples/actions-pipenv_requirements.yml)

## Details

Uses `actions/setup-python@v2`. Only python `3.6` - `3.10` version are tested since
they are by far most common now. Other python `3.x` versions should also work.
Any python `2.x` versions are unsupported! You can lint on Linux, Windows and MacOS.

The lintner versions are:

```bash
pycodestyle==2.8.0
pydocstyle==6.1.1
pylint==2.12.1
mypy==0.910
black==21.11b1
flake8==4.0.1
vulture==2.3
isort==5.10.1
```
The linter versions are defined in [requirements.txt](requirements.txt)

## IMPORTANT - test environment

Expand Down
10 changes: 5 additions & 5 deletionsaction.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,20 +86,20 @@ runs:
python-version: ${{ inputs.python-version }}
architecture: x64
cache: pip

- run: python --version
shell: bash

- name: Windows install dependencies
if: ${{ runner.os == 'Windows' }}
run: |
pip install -r ${{ github.action_path }}\requirements.txt
pip install -r requirements.txt # project's dependencies
pip install -r ${{ github.action_path }}\requirements.txt # linters
echo "path_sep=" >> $GITHUB_ENV
shell: pwsh

- name: Posix install dependencies
if: ${{ runner.os != 'Windows' }}
run: pip install -r ${{ github.action_path }}/requirements.txt
run: |
pip install -r requirements.txt # project's dependencies
pip install -r ${{ github.action_path }}/requirements.txt # linters

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

setup-python'scache argument was expecting a requirements.txt but is not doing the install

See the example in their readme file:
https://github.com/actions/setup-python#caching-packages-dependencies

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yeah, i have noticed this as well. Thanks for the fix

shell: bash

- name: Lint on Windows
Expand Down
20 changes: 20 additions & 0 deletionsexamples/actions-pipenv_requirements.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
name: Install requirements from pipenv and lint all files
on:
pull_request:
types: [ opened, reopened, synchronize, edited ]
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Generate requirements.txt file
run: |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm thinking if shouldn't just do this automatically? Check if the requirements file exists (provided by user). If not, install pipenv and generate dependencies.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If you have time to do that then go ahead, but I don't

pip install pipenv
pipenv requirements > requirements.txt
- uses: marian-code/python-lint-annotate@v3
4 changes: 2 additions & 2 deletionsrequirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
black==21.11b1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We also need to update README file

black~=22.3.0
flake8==4.0.1
isort==5.10.1
mypy~=0.961
pycodestyle==2.8.0
pydocstyle==6.1.1
pylint==2.12.1
vulture==2.3
vulture==2.3

[8]ページ先頭

©2009-2025 Movatter.jp