Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
Changelog
=========

next-version
------------

- Create PyPI cache location in the home directory if a cache directory cannot be made at the project root.


v0.9.3
------

- Add support for recursive requirements.
- Add python 3.11 as a valid python version in choices.
- Operating system and python version are now required fields in CLI.
- Add dot versions (3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 2.7) with
- Add dot versions (3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 2.7) with
current python version choices for CLI (36, 37, 38, 39, 310, 311, 27).


Expand Down Expand Up @@ -109,7 +114,7 @@ v0.6.3
------

- Ensure to filter out top level dependencies on the basis of their environment markers
- Do not ignore files on basis of name
- Do not ignore files on basis of name


v0.6.2
Expand All @@ -123,7 +128,7 @@ v0.6.1
------

- Use latest ScanCode toolkit packagedcode including the ability to collect
extra index URLs from requirements.txt
extra index URLs from requirements.txt
- Use new pipdeptree-like format for improved compatibility
- Rename command line tool name from "dad" to "python-inspector"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ valid: isort black
check:
@echo "-> Run pycodestyle (PEP8) validation"
@${ACTIVATE} pycodestyle --max-line-length=110 \
--exclude=.eggs,etc/scripts,src/_packagedcode,venv,lib,thirdparty,docs .
--exclude=.eggs,etc/scripts,src/_packagedcode,venv/,lib/,thirdparty/,docs/,.cache/ .
@echo "-> Run isort imports ordering validation"
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests --skip-glob "*/_packagedcode/*"
@echo "-> Run black validation"
Expand Down
29 changes: 18 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,54 @@ jobs:
parameters:
job_name: ubuntu18_cpython
image_name: ubuntu-18.04
python_versions: ['3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: |
venv/bin/pytest -n 2 -vvs --reruns 2
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macos-12
python_versions: ['3.8', '3.9', '3.10']
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython
image_name: macos-11
python_versions: ['3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macos-12
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs --reruns 2
all: venv\Scripts\pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ['3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs --reruns 2
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
VIRTUALENV_DIR=venv

# Cleanable files and directories to delete with the --clean option
CLEANABLE="build venv"
CLEANABLE="build dist venv .cache .eggs"

# extra arguments passed to pip
PIP_EXTRA_ARGS=" "
Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set "DOCS_REQUIREMENTS=--editable .[docs] --constraint requirements.txt"
set "VIRTUALENV_DIR=venv"

@rem # Cleanable files and directories to delete with the --clean option
set "CLEANABLE=build venv"
set "CLEANABLE=build dist venv .cache .eggs"

@rem # extra arguments passed to pip
set "PIP_EXTRA_ARGS= "
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
# this is used populated when creating a git archive
# and when there is .git dir and/or there is no git installed
fallback_version = "9999.$Format:%h-%cs$"
fallback_version = "9999.9999.99"

[tool.pytest.ini_options]
norecursedirs = [
Expand Down
12 changes: 11 additions & 1 deletion src/python_inspector/utils_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import email
import itertools
import os
import pathlib
import re
import shutil
import tempfile
Expand Down Expand Up @@ -174,7 +175,16 @@ def get_python_dot_version(version):
],
}

CACHE_THIRDPARTY_DIR = ".cache/thirdparty"
CACHE_THIRDPARTY_DIR = os.environ.get("PYTHON_INSPECTOR_CACHE_DIR")
if not CACHE_THIRDPARTY_DIR:
CACHE_THIRDPARTY_DIR = ".cache/python_inspector"
try:
os.makedirs(CACHE_THIRDPARTY_DIR, exist_ok=True)
except Exception:
home = pathlib.Path.home()
CACHE_THIRDPARTY_DIR = str(home / ".cache/python_inspector")
os.makedirs(CACHE_THIRDPARTY_DIR, exist_ok=True)


################################################################################

Expand Down
4 changes: 2 additions & 2 deletions tests/data/azure-devops.req-310-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.9.3",
"options": [
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
"--requirement /home/jono/nexb/src/python-inspector/tests/data/azure-devops.req.txt",
"--index-url https://pypi.org/simple",
"--python-version 310",
"--operating-system linux",
Expand All @@ -17,7 +17,7 @@
"files": [
{
"type": "file",
"path": "/home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
"path": "/home/jono/nexb/src/python-inspector/tests/data/azure-devops.req.txt",
"package_data": [
{
"type": "pypi",
Expand Down
4 changes: 2 additions & 2 deletions tests/data/azure-devops.req-38-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.9.3",
"options": [
"--requirement /home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
"--requirement /home/jono/nexb/src/python-inspector/tests/data/azure-devops.req.txt",
"--index-url https://pypi.org/simple",
"--python-version 38",
"--operating-system linux",
Expand All @@ -17,7 +17,7 @@
"files": [
{
"type": "file",
"path": "/home/tg1999/Desktop/python-inspector-1/tests/data/azure-devops.req.txt",
"path": "/home/jono/nexb/src/python-inspector/tests/data/azure-devops.req.txt",
"package_data": [
{
"type": "pypi",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/insecure-setup-2/setup.py-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"files": [
{
"type": "file",
"path": "/home/tg1999/Desktop/python-inspector-1/tests/data/insecure-setup-2/setup.py",
"path": "/home/jono/nexb/src/python-inspector/tests/data/insecure-setup-2/setup.py",
"package_data": [
{
"type": "pypi",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import pytest
from commoncode.testcase import FileDrivenTesting
from test_cli import check_json_results

from python_inspector.resolve_cli import resolver_api
from tests.test_cli import check_json_results

test_env = FileDrivenTesting()
test_env.test_data_dir = os.path.join(os.path.dirname(__file__), "data")
Expand Down