mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 20:15:22 +00:00
Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b3d0b4443b | ||
![]() |
2ef6a981d5 | ||
![]() |
fcfe190bed | ||
![]() |
38af24c1d1 | ||
![]() |
645451aa39 | ||
![]() |
2326604c81 | ||
![]() |
6e0447755c | ||
![]() |
da63e0d71c | ||
![]() |
a7a6b856b0 | ||
![]() |
cdcf14bce6 | ||
![]() |
1f462ab50a | ||
![]() |
287da35bc2 | ||
![]() |
58d62cb7b8 | ||
![]() |
36efbbe460 | ||
![]() |
08c5eb09cc | ||
![]() |
34163de8d0 | ||
![]() |
d6d06a2f1f | ||
![]() |
1c319d7106 | ||
![]() |
d6725caee6 | ||
![]() |
ebfa1f4832 | ||
![]() |
9eedfb39db | ||
![]() |
e5336a446a | ||
![]() |
648a43ffbe | ||
![]() |
3d490ec251 | ||
![]() |
4c65892517 | ||
![]() |
a14e8b4256 | ||
![]() |
cc8545d530 | ||
![]() |
aabe973eb1 | ||
![]() |
5cdc9019d7 | ||
![]() |
08eead345a | ||
![]() |
967a6688cb | ||
![]() |
eb37d03ff7 | ||
![]() |
1e9cc81f8e | ||
![]() |
75e7892310 | ||
![]() |
4767b6444e | ||
![]() |
e4faec2c1e | ||
![]() |
ab492859f4 | ||
![]() |
c3d0f169d3 | ||
![]() |
c0d6b293b1 | ||
![]() |
de13f174c3 |
24
.github/workflows/flake8.yml
vendored
24
.github/workflows/flake8.yml
vendored
@ -1,18 +1,32 @@
|
|||||||
name: flake8
|
name: flake8
|
||||||
|
|
||||||
on: pull_request
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- "release/*"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
flake8-lint:
|
flake8-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
name: Lint
|
name: Lint
|
||||||
steps:
|
steps:
|
||||||
- name: Check out source repository
|
- name: Check out source repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Set up Python environment
|
- name: Set up Python environment
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.13"
|
||||||
- name: flake8 Lint
|
- name: flake8 Lint
|
||||||
uses: reviewdog/action-flake8@v3
|
uses: reviewdog/action-flake8@v3
|
||||||
with:
|
with:
|
||||||
|
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
@ -1,46 +1,55 @@
|
|||||||
name: Tests and Codecov
|
name: Tests and Codecov
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- "release/*"
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_tests:
|
run_tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-7.3.12']
|
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.10']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install uv
|
||||||
pip install tox tox-gh-actions
|
uv pip install --system tox tox-gh-actions
|
||||||
|
|
||||||
- name: Test with tox
|
- name: Test with tox
|
||||||
run: tox
|
run: tox
|
||||||
|
|
||||||
coverage_report:
|
coverage_report:
|
||||||
needs: run_tests
|
needs: run_tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python 3.13
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.13
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install uv
|
||||||
pip install poetry
|
uv pip install --system poetry
|
||||||
poetry install --with dev
|
uv pip install --system .[dev]
|
||||||
|
|
||||||
- name: Calculate coverage
|
- name: Calculate coverage
|
||||||
run: poetry run coverage run --source=pipreqs -m unittest discover
|
run: poetry run coverage run --source=pipreqs -m unittest discover
|
||||||
@ -49,7 +58,8 @@ jobs:
|
|||||||
run: poetry run coverage xml
|
run: poetry run coverage xml
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
files: coverage.xml
|
files: coverage.xml
|
||||||
fail_ci_if_error: true
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
fail_ci_if_error: false
|
||||||
|
96
.pre-commit-config.yaml
Normal file
96
.pre-commit-config.yaml
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
ci:
|
||||||
|
autoupdate_commit_msg: "chore: update pre-commit hooks"
|
||||||
|
autofix_commit_msg: "style: pre-commit fixes"
|
||||||
|
autoupdate_schedule: quarterly
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: check-added-large-files
|
||||||
|
args: [ '--maxkb=1000' ]
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-symlinks
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-json
|
||||||
|
- id: debug-statements
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: requirements-txt-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
files: ".*\\.(?:tex|py)$"
|
||||||
|
args: [ --markdown-linebreak-ext=md ]
|
||||||
|
exclude: (^notebooks/|^tests/truth/)
|
||||||
|
- id: detect-private-key
|
||||||
|
- id: fix-byte-order-marker
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-docstring-first
|
||||||
|
- id: debug-statements
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
|
rev: v1.10.0
|
||||||
|
hooks:
|
||||||
|
- id: python-use-type-annotations
|
||||||
|
- id: python-check-mock-methods
|
||||||
|
- id: python-no-eval
|
||||||
|
- id: rst-backticks
|
||||||
|
- id: rst-directive-colons
|
||||||
|
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v3.3.1
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: [ --py38-plus ]
|
||||||
|
|
||||||
|
# Notebook formatting
|
||||||
|
- repo: https://github.com/nbQA-dev/nbQA
|
||||||
|
rev: 1.9.1
|
||||||
|
hooks:
|
||||||
|
- id: nbqa-isort
|
||||||
|
additional_dependencies: [ isort ]
|
||||||
|
|
||||||
|
- id: nbqa-pyupgrade
|
||||||
|
additional_dependencies: [ pyupgrade ]
|
||||||
|
args: [ --py38-plus ]
|
||||||
|
|
||||||
|
|
||||||
|
- repo: https://github.com/kynan/nbstripout
|
||||||
|
rev: 0.8.1
|
||||||
|
hooks:
|
||||||
|
- id: nbstripout
|
||||||
|
|
||||||
|
- repo: https://github.com/sondrelg/pep585-upgrade
|
||||||
|
rev: 'v1.0'
|
||||||
|
hooks:
|
||||||
|
- id: upgrade-type-hints
|
||||||
|
args: [ '--futures=true' ]
|
||||||
|
|
||||||
|
- repo: https://github.com/MarcoGorelli/auto-walrus
|
||||||
|
rev: 0.3.4
|
||||||
|
hooks:
|
||||||
|
- id: auto-walrus
|
||||||
|
|
||||||
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||||
|
rev: 0.30.0
|
||||||
|
hooks:
|
||||||
|
- id: check-github-workflows
|
||||||
|
- id: check-github-actions
|
||||||
|
- id: check-dependabot
|
||||||
|
- id: check-readthedocs
|
||||||
|
|
||||||
|
- repo: https://github.com/dannysepler/rm_unneeded_f_str
|
||||||
|
rev: v0.2.0
|
||||||
|
hooks:
|
||||||
|
- id: rm-unneeded-f-str
|
||||||
|
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: "v0.8.6"
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
types_or: [ python, pyi, jupyter ]
|
||||||
|
args: [ --fix, --show-fixes , --line-length=120 ] # --unsafe-fixes,
|
||||||
|
# Run the formatter.
|
||||||
|
- id: ruff-format
|
||||||
|
types_or: [ python, pyi, jupyter ]
|
@ -1,3 +1,4 @@
|
|||||||
|
3.13
|
||||||
3.12
|
3.12
|
||||||
3.11
|
3.11
|
||||||
3.10
|
3.10
|
||||||
|
@ -1 +1 @@
|
|||||||
python 3.12 3.11 3.10 3.9 3.8 pypy3.9-7.3.12
|
python 3.13 3.12 3.11 3.10 3.9 3.8 pypy3.9-7.3.12
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
``pipreqs`` - Generate requirements.txt file for any project based on imports
|
``pipreqs`` - Generate requirements.txt file for any project based on imports
|
||||||
=============================================================================
|
=============================================================================
|
||||||
|
|
||||||
.. image:: https://img.shields.io/travis/bndr/pipreqs.svg
|
.. image:: https://github.com/bndr/pipreqs/actions/workflows/tests.yml/badge.svg
|
||||||
:target: https://travis-ci.org/bndr/pipreqs
|
:target: https://github.com/bndr/pipreqs/actions/workflows/tests.yml
|
||||||
|
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/v/pipreqs.svg
|
.. image:: https://img.shields.io/pypi/v/pipreqs.svg
|
||||||
@ -55,6 +55,7 @@ Usage
|
|||||||
--debug Print debug information
|
--debug Print debug information
|
||||||
--ignore <dirs>... Ignore extra directories, each separated by a comma
|
--ignore <dirs>... Ignore extra directories, each separated by a comma
|
||||||
--no-follow-links Do not follow symbolic links in the project
|
--no-follow-links Do not follow symbolic links in the project
|
||||||
|
--ignore-errors Ignore errors while scanning files
|
||||||
--encoding <charset> Use encoding parameter for file open
|
--encoding <charset> Use encoding parameter for file open
|
||||||
--savepath <file> Save the list of requirements in the given file
|
--savepath <file> Save the list of requirements in the given file
|
||||||
--print Output the list of requirements in the standard output
|
--print Output the list of requirements in the standard output
|
||||||
|
@ -36,6 +36,7 @@ Pyxides:astro_pyxis
|
|||||||
QtCore:PySide
|
QtCore:PySide
|
||||||
S3:s3cmd
|
S3:s3cmd
|
||||||
SCons:pystick
|
SCons:pystick
|
||||||
|
speech_recognition:SpeechRecognition
|
||||||
Shared:Zope2
|
Shared:Zope2
|
||||||
Signals:Zope2
|
Signals:Zope2
|
||||||
Stemmer:PyStemmer
|
Stemmer:PyStemmer
|
||||||
@ -582,6 +583,7 @@ ctff:tff
|
|||||||
cups:pycups
|
cups:pycups
|
||||||
curator:elasticsearch_curator
|
curator:elasticsearch_curator
|
||||||
curl:pycurl
|
curl:pycurl
|
||||||
|
cv2:opencv-python
|
||||||
daemon:python_daemon
|
daemon:python_daemon
|
||||||
dare:DARE
|
dare:DARE
|
||||||
dateutil:python_dateutil
|
dateutil:python_dateutil
|
||||||
@ -720,6 +722,7 @@ jaraco:jaraco.util
|
|||||||
jinja2:Jinja2
|
jinja2:Jinja2
|
||||||
jiracli:jira_cli
|
jiracli:jira_cli
|
||||||
johnny:johnny_cache
|
johnny:johnny_cache
|
||||||
|
jose:python_jose
|
||||||
jpgrid:python_geohash
|
jpgrid:python_geohash
|
||||||
jpiarea:python_geohash
|
jpiarea:python_geohash
|
||||||
jpype:JPype1
|
jpype:JPype1
|
||||||
@ -975,6 +978,7 @@ pysynth_samp:PySynth
|
|||||||
pythongettext:python_gettext
|
pythongettext:python_gettext
|
||||||
pythonjsonlogger:python_json_logger
|
pythonjsonlogger:python_json_logger
|
||||||
pyutilib:PyUtilib
|
pyutilib:PyUtilib
|
||||||
|
pywintypes:pywin32
|
||||||
pyximport:Cython
|
pyximport:Cython
|
||||||
qs:qserve
|
qs:qserve
|
||||||
quadtree:python_geohash
|
quadtree:python_geohash
|
||||||
|
@ -20,6 +20,7 @@ Options:
|
|||||||
$ export HTTPS_PROXY="https://10.10.1.10:1080"
|
$ export HTTPS_PROXY="https://10.10.1.10:1080"
|
||||||
--debug Print debug information
|
--debug Print debug information
|
||||||
--ignore <dirs>... Ignore extra directories, each separated by a comma
|
--ignore <dirs>... Ignore extra directories, each separated by a comma
|
||||||
|
--ignore-errors Ignore errors while scanning files
|
||||||
--no-follow-links Do not follow symbolic links in the project
|
--no-follow-links Do not follow symbolic links in the project
|
||||||
--encoding <charset> Use encoding parameter for file open
|
--encoding <charset> Use encoding parameter for file open
|
||||||
--savepath <file> Save the list of requirements in the given file
|
--savepath <file> Save the list of requirements in the given file
|
||||||
@ -31,7 +32,7 @@ Options:
|
|||||||
--clean <file> Clean up requirements.txt by removing modules
|
--clean <file> Clean up requirements.txt by removing modules
|
||||||
that are not imported in project
|
that are not imported in project
|
||||||
--mode <scheme> Enables dynamic versioning with <compat>,
|
--mode <scheme> Enables dynamic versioning with <compat>,
|
||||||
<gt> or <non-pin> schemes.
|
<gt> or <no-pin> schemes.
|
||||||
<compat> | e.g. Flask~=1.1.2
|
<compat> | e.g. Flask~=1.1.2
|
||||||
<gt> | e.g. Flask>=1.1.2
|
<gt> | e.g. Flask>=1.1.2
|
||||||
<no-pin> | e.g. Flask
|
<no-pin> | e.g. Flask
|
||||||
@ -97,11 +98,10 @@ def _open(filename=None, mode="r"):
|
|||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
def get_all_imports(path, encoding="utf-8", extra_ignore_dirs=None, follow_links=True):
|
def get_all_imports(path, encoding="utf-8", extra_ignore_dirs=None, follow_links=True, ignore_errors=False):
|
||||||
imports = set()
|
imports = set()
|
||||||
raw_imports = set()
|
raw_imports = set()
|
||||||
candidates = []
|
candidates = []
|
||||||
ignore_errors = False
|
|
||||||
ignore_dirs = [
|
ignore_dirs = [
|
||||||
".hg",
|
".hg",
|
||||||
".svn",
|
".svn",
|
||||||
@ -110,6 +110,7 @@ def get_all_imports(path, encoding="utf-8", extra_ignore_dirs=None, follow_links
|
|||||||
"__pycache__",
|
"__pycache__",
|
||||||
"env",
|
"env",
|
||||||
"venv",
|
"venv",
|
||||||
|
".venv",
|
||||||
".ipynb_checkpoints",
|
".ipynb_checkpoints",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -133,9 +134,9 @@ def get_all_imports(path, encoding="utf-8", extra_ignore_dirs=None, follow_links
|
|||||||
|
|
||||||
for file_name in files:
|
for file_name in files:
|
||||||
file_name = os.path.join(root, file_name)
|
file_name = os.path.join(root, file_name)
|
||||||
contents = read_file_content(file_name, encoding)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
contents = read_file_content(file_name, encoding)
|
||||||
tree = ast.parse(contents)
|
tree = ast.parse(contents)
|
||||||
for node in ast.walk(tree):
|
for node in ast.walk(tree):
|
||||||
if isinstance(node, ast.Import):
|
if isinstance(node, ast.Import):
|
||||||
@ -145,7 +146,7 @@ def get_all_imports(path, encoding="utf-8", extra_ignore_dirs=None, follow_links
|
|||||||
raw_imports.add(node.module)
|
raw_imports.add(node.module)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
if ignore_errors:
|
if ignore_errors:
|
||||||
traceback.print_exc(exc)
|
traceback.print_exc()
|
||||||
logging.warn("Failed on file: %s" % file_name)
|
logging.warn("Failed on file: %s" % file_name)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
@ -504,6 +505,7 @@ def init(args):
|
|||||||
encoding = args.get("--encoding")
|
encoding = args.get("--encoding")
|
||||||
extra_ignore_dirs = args.get("--ignore")
|
extra_ignore_dirs = args.get("--ignore")
|
||||||
follow_links = not args.get("--no-follow-links")
|
follow_links = not args.get("--no-follow-links")
|
||||||
|
ignore_errors = args.get("--ignore-errors")
|
||||||
|
|
||||||
scan_noteboooks = args.get("--scan-notebooks", False)
|
scan_noteboooks = args.get("--scan-notebooks", False)
|
||||||
handle_scan_noteboooks()
|
handle_scan_noteboooks()
|
||||||
@ -535,6 +537,7 @@ def init(args):
|
|||||||
encoding=encoding,
|
encoding=encoding,
|
||||||
extra_ignore_dirs=extra_ignore_dirs,
|
extra_ignore_dirs=extra_ignore_dirs,
|
||||||
follow_links=follow_links,
|
follow_links=follow_links,
|
||||||
|
ignore_errors=ignore_errors,
|
||||||
)
|
)
|
||||||
candidates = get_pkg_names(candidates)
|
candidates = get_pkg_names(candidates)
|
||||||
logging.debug("Found imports: " + ", ".join(candidates))
|
logging.debug("Found imports: " + ", ".join(candidates))
|
||||||
|
1585
poetry.lock
generated
1585
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,15 @@
|
|||||||
[tool.poetry]
|
[project]
|
||||||
name = "pipreqs"
|
name = "pipreqs"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
description = "Pip requirements.txt generator based on imports in project"
|
description = "Pip requirements.txt generator based on imports in project"
|
||||||
authors = ["Vadim Kravcenko <vadim.kravcenko@gmail.com>"]
|
authors = [
|
||||||
|
{ name = "Vadim Kravcenko", email = "vadim.kravcenko@gmail.com" }
|
||||||
|
]
|
||||||
|
maintainers = [
|
||||||
|
{name = "Jonas Eschle", email = "jonas.eschle@gmail.com"}
|
||||||
|
]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
readme = ["README.rst", "HISTORY.rst"]
|
readme = "README.rst"
|
||||||
packages = [{ include = "pipreqs" }]
|
packages = [{ include = "pipreqs" }]
|
||||||
repository = "https://github.com/bndr/pipreqs"
|
repository = "https://github.com/bndr/pipreqs"
|
||||||
keywords = ["pip", "requirements", "imports"]
|
keywords = ["pip", "requirements", "imports"]
|
||||||
@ -14,29 +19,35 @@ classifiers = [
|
|||||||
"License :: OSI Approved :: Apache Software License",
|
"License :: OSI Approved :: Apache Software License",
|
||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.8",
|
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12"
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
]
|
]
|
||||||
|
requires-python = ">=3.9, <3.14"
|
||||||
[tool.poetry.scripts]
|
dependencies = [
|
||||||
pipreqs = "pipreqs.pipreqs:main"
|
"yarg>=0.1.9",
|
||||||
|
"docopt>=0.6.2",
|
||||||
[tool.poetry.dependencies]
|
"nbconvert>=7.11.0",
|
||||||
python = ">=3.8.1,<3.13"
|
"ipython>=8.12.3",
|
||||||
yarg = "0.1.9"
|
]
|
||||||
docopt = "0.6.2"
|
[project.optional-dependencies]
|
||||||
nbconvert = "^7.11.0"
|
dev = [
|
||||||
ipython = "8.12.3"
|
"flake8>=6.1.0",
|
||||||
|
"tox>=4.11.3",
|
||||||
[tool.poetry.group.dev.dependencies]
|
"coverage>=7.3.2",
|
||||||
|
"sphinx>=7.2.6;python_version>='3.9'",
|
||||||
|
]
|
||||||
|
[tool.poetry.group.dev.dependencies] # for legacy usage
|
||||||
flake8 = "^6.1.0"
|
flake8 = "^6.1.0"
|
||||||
tox = "^4.11.3"
|
tox = "^4.11.3"
|
||||||
coverage = "^7.3.2"
|
coverage = "^7.3.2"
|
||||||
sphinx = { version = "^7.2.6", python = ">=3.9" }
|
sphinx = { version = "^7.2.6", python = ">=3.9" }
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
pipreqs = "pipreqs.pipreqs:main"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
@ -114,6 +114,13 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
self.assertRaises(SyntaxError, pipreqs.get_all_imports, self.project_invalid)
|
self.assertRaises(SyntaxError, pipreqs.get_all_imports, self.project_invalid)
|
||||||
|
|
||||||
|
def test_ignore_errors(self):
|
||||||
|
"""
|
||||||
|
Test that invalid python files do not raise an exception when ignore_errors is True.
|
||||||
|
"""
|
||||||
|
imports = pipreqs.get_all_imports(self.project_invalid, ignore_errors=True)
|
||||||
|
self.assertEqual(len(imports), 0)
|
||||||
|
|
||||||
def test_get_imports_info(self):
|
def test_get_imports_info(self):
|
||||||
"""
|
"""
|
||||||
Test to see that the right number of packages were found on PyPI
|
Test to see that the right number of packages were found on PyPI
|
||||||
|
6
tox.ini
6
tox.ini
@ -1,15 +1,15 @@
|
|||||||
[tox]
|
[tox]
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
envlist = py38, py39, py310, py311, py312, pypy3, flake8
|
envlist = py39, py310, py311, py312, py313, pypy3, flake8
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.8: py38
|
|
||||||
3.9: py39
|
3.9: py39
|
||||||
3.10: py310
|
3.10: py310
|
||||||
3.11: py311
|
3.11: py311
|
||||||
3.12: py312
|
3.12: py312
|
||||||
pypy-3.9-7.3.12: pypy3
|
3.13: py313
|
||||||
|
pypy-3.10: pypy3
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv =
|
setenv =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user