diff --git a/CHANGELOG.md b/CHANGELOG.md index 15540e7a..24c07aca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog Note: version releases in the 0.x.y range may introduce breaking changes. +## 0.1.4 +- Make check_url 403 results a warning +- Add python build tools +- Refresh SPDX list + ## 0.1.3 - Python 3.11+ will only be supported for now for ease of maintenance - Improves error and warnings output, loosely following what C compilers tend to with a "report" section diff --git a/anaconda_linter/__init__.py b/anaconda_linter/__init__.py index 0aee4055..d0d7514b 100644 --- a/anaconda_linter/__init__.py +++ b/anaconda_linter/__init__.py @@ -3,7 +3,7 @@ Description: Module configurations for the `anaconda-linter` project """ __name__ = "anaconda_linter" # pylint: disable=redefined-builtin -__version__ = "0.1.3" +__version__ = "0.1.4" __author__ = "Anaconda, Inc." __email__ = "distribution_team@anaconda.com" __license__ = "BSD-3-Clause" diff --git a/anaconda_linter/data/cbc_default.yaml b/anaconda_linter/data/cbc_default.yaml index 58f0a6c0..2aff92cb 100644 --- a/anaconda_linter/data/cbc_default.yaml +++ b/anaconda_linter/data/cbc_default.yaml @@ -25,7 +25,7 @@ osx-64: 0 osx-arm64: 0 arm64: 0 -py: 310 +py: 311 py3k: 1 py2k: 0 py26: 0 @@ -37,9 +37,10 @@ py36: 0 py37: 0 py38: 0 py39: 0 -py310: 1 -py311: 0 +py310: 0 +py311: 1 +py312: 0 +py313: 0 numpy: "1.21" -nunpy: "1.21" -np: "1.16" +np: "1.21" pl: "5.26" diff --git a/anaconda_linter/data/license_exceptions.txt b/anaconda_linter/data/license_exceptions.txt index ce0aaddd..f44e1485 100644 --- a/anaconda_linter/data/license_exceptions.txt +++ b/anaconda_linter/data/license_exceptions.txt @@ -1,10 +1,12 @@ 389-exception Asterisk-exception +Asterisk-linking-protocols-exception Autoconf-exception-2.0 Autoconf-exception-3.0 Autoconf-exception-generic Autoconf-exception-generic-3.0 Autoconf-exception-macro +Bison-exception-1.24 Bison-exception-2.2 Bootloader-exception Classpath-exception-2.0 @@ -12,14 +14,21 @@ CLISP-exception-2.0 cryptsetup-OpenSSL-exception DigiRule-FOSS-exception eCos-exception-2.0 +erlang-otp-linking-exception Fawkes-Runtime-exception FLTK-exception +fmt-exception Font-exception-2.0 freertos-exception-2.0 GCC-exception-2.0 +GCC-exception-2.0-note GCC-exception-3.1 +Gmsh-exception GNAT-exception +GNOME-examples-exception +GNU-compiler-exception gnu-javamail-exception +GPL-3.0-389-ds-base-exception GPL-3.0-interface-exception GPL-3.0-linking-exception GPL-3.0-linking-source-exception @@ -41,15 +50,21 @@ OCaml-LGPL-linking-exception OCCT-exception-1.0 OpenJDK-assembly-exception-1.0 openvpn-openssl-exception +PCRE2-exception PS-or-PDF-font-exception-20170817 QPL-1.0-INRIA-2004-exception Qt-GPL-exception-1.0 Qt-LGPL-exception-1.1 Qwt-exception-1.0 +romic-exception +RRDtool-FLOSS-exception-2.0 +SANE-exception SHL-2.0 SHL-2.1 +stunnel-exception SWI-exception Swift-exception +Texinfo-exception u-boot-exception-2.0 UBDL-exception Universal-FOSS-exception-1.0 diff --git a/anaconda_linter/data/licenses.txt b/anaconda_linter/data/licenses.txt index 19c4de3f..db0bf935 100644 --- a/anaconda_linter/data/licenses.txt +++ b/anaconda_linter/data/licenses.txt @@ -1,8 +1,10 @@ 0BSD +3D-Slicer-1.0 AAL Abstyles AdaCore-doc Adobe-2006 +Adobe-Display-PostScript Adobe-Glyph Adobe-Utopia ADSL @@ -19,11 +21,14 @@ AGPL-3.0 AGPL-3.0-only AGPL-3.0-or-later Aladdin +AMD-newlib AMDPLPA AML +AML-glslang AMPAS ANTLR-PD ANTLR-PD-fallback +any-OSI Apache-1.0 Apache-1.1 Apache-2.0 @@ -44,6 +49,7 @@ ASWF-Digital-Assets-1.1 Baekmuk Bahyph Barr +bcrypt-Solar-Designer Beerware Bitstream-Charter Bitstream-Vera @@ -53,16 +59,21 @@ blessing BlueOak-1.0.0 Boehm-GC Borceux +Brian-Gladman-2-Clause Brian-Gladman-3-Clause BSD-1-Clause BSD-2-Clause +BSD-2-Clause-Darwin +BSD-2-Clause-first-lines BSD-2-Clause-FreeBSD BSD-2-Clause-NetBSD BSD-2-Clause-Patent BSD-2-Clause-Views BSD-3-Clause +BSD-3-Clause-acpica BSD-3-Clause-Attribution BSD-3-Clause-Clear +BSD-3-Clause-flex BSD-3-Clause-HP BSD-3-Clause-LBNL BSD-3-Clause-Modification @@ -81,8 +92,10 @@ BSD-Advertising-Acknowledgement BSD-Attribution-HPND-disclaimer BSD-Inferno-Nettverk BSD-Protection +BSD-Source-beginning-file BSD-Source-Code BSD-Systemics +BSD-Systemics-W3Works BSL-1.0 BUSL-1.1 bzip2-1.0.5 @@ -91,6 +104,8 @@ C-UDA-1.0 CAL-1.0 CAL-1.0-Combined-Work-Exception Caldera +Caldera-no-preamble +Catharon CATOSL-1.1 CC-BY-1.0 CC-BY-2.0 @@ -98,6 +113,7 @@ CC-BY-2.5 CC-BY-2.5-AU CC-BY-3.0 CC-BY-3.0-AT +CC-BY-3.0-AU CC-BY-3.0-DE CC-BY-3.0-IGO CC-BY-3.0-NL @@ -167,6 +183,7 @@ checkmk ClArtistic Clips CMU-Mach +CMU-Mach-nodoc CNRI-Jython CNRI-Python CNRI-Python-GPL-Compatible @@ -185,13 +202,19 @@ CrystalStacker CUA-OPL-1.0 Cube curl +cve-tou D-FSL-1.0 +DEC-3-Clause diffmark DL-DE-BY-2.0 DL-DE-ZERO-2.0 DOC +DocBook-Schema +DocBook-Stylesheet +DocBook-XML Dotseqn DRL-1.0 +DRL-1.1 DSDP dtoa dvipdfm @@ -221,12 +244,14 @@ Frameworx-1.0 FreeBSD-DOC FreeImage FSFAP +FSFAP-no-warranty-disclaimer FSFUL FSFULLR FSFULLRWD FTL Furuseth fwlw +GCR-docs GD GFDL-1.1 GFDL-1.1-invariants-only @@ -254,7 +279,6 @@ GL2PS Glide Glulxe GLWTPL -GNU-compiler-exception gnuplot GPL-1.0 GPL-1.0+ @@ -277,21 +301,38 @@ GPL-3.0-with-autoconf-exception GPL-3.0-with-GCC-exception Graphics-Gems gSOAP-1.3b +gtkbook +Gutmann HaskellReport +hdparm +HIDAPI Hippocratic-2.1 HP-1986 HP-1989 HPND HPND-DEC +HPND-doc HPND-doc-sell HPND-export-US +HPND-export-US-acknowledgement HPND-export-US-modify +HPND-export2-US +HPND-Fenneberg-Livingston +HPND-INRIA-IMAG +HPND-Intel +HPND-Kevlin-Henney HPND-Markus-Kuhn +HPND-merchantability-variant +HPND-MIT-disclaimer +HPND-Netrek HPND-Pbmplus +HPND-sell-MIT-disclaimer-xserver HPND-sell-regexpr HPND-sell-variant HPND-sell-variant-MIT-disclaimer +HPND-sell-variant-MIT-disclaimer-rev HPND-UC +HPND-UC-export-US HTMLTIDY IBM-pibs ICU @@ -309,6 +350,7 @@ Interbase-1.0 IPA IPL-1.0 ISC +ISC-Veillard Jam JasPer-2.0 JPL-image @@ -349,6 +391,7 @@ Linux-man-pages-copyleft-2-para Linux-man-pages-copyleft-var Linux-OpenIB LOOP +LPD-document LPL-1.0 LPL-1.02 LPPL-1.0 @@ -360,7 +403,10 @@ lsof Lucida-Bitmap-Fonts LZMA-SDK-9.11-to-9.20 LZMA-SDK-9.22 +Mackerras-3-Clause +Mackerras-3-Clause-acknowledgment magaz +mailprio MakeIndex Martin-Birgmeier McPhee-slideshow @@ -370,10 +416,12 @@ MirOS MIT MIT-0 MIT-advertising +MIT-Click MIT-CMU MIT-enna MIT-feh MIT-Festival +MIT-Khronos-old MIT-Modern-Variant MIT-open-group MIT-testregex @@ -401,7 +449,9 @@ NAIST-2003 NASA-1.3 Naumen NBPL-1.0 +NCBI-PD NCGL-UK-2.0 +NCL NCSA Net-SNMP NetCDF @@ -425,6 +475,7 @@ NTP NTP-0 Nunit O-UDA-1.0 +OAR OCCT-PL OCLC-2.0 ODbL-1.0 @@ -463,6 +514,8 @@ OLFL-1.3 OML OpenPBS-2.3 OpenSSL +OpenSSL-standalone +OpenVision OPL-1.0 OPL-UK-3.0 OPUBL-1.0 @@ -478,11 +531,14 @@ Parity-7.0.0 PDDL-1.0 PHP-3.0 PHP-3.01 +Pixar +pkgconf Plexus pnmstitch PolyForm-Noncommercial-1.0.0 PolyForm-Small-Business-1.0.0 PostgreSQL +PPL PSF-2.0 psfrag psutils @@ -492,6 +548,7 @@ python-ldap Qhull QPL-1.0 QPL-1.0-INRIA-2004 +radvd Rdisc RHeCos-1.1 RPL-1.1 @@ -500,8 +557,9 @@ RPSL-1.0 RSA-MD RSCPL Ruby -SANE-exception +Ruby-pty SAX-PD +SAX-PD-2.0 Saxpath SCEA SchemeReport @@ -523,6 +581,7 @@ SMLNJ SMPPL SNIA snprintf +softSurfer Soundex Spencer-86 Spencer-94 @@ -531,10 +590,12 @@ SPL-1.0 ssh-keyscan SSH-OpenSSH SSH-short +SSLeay-standalone SSPL-1.0 StandardML-NJ -stunnel-exception SugarCRM-1.1.3 +Sun-PPP +Sun-PPP-2000 SunPro SWL swrule @@ -543,19 +604,24 @@ TAPR-OHL-1.0 TCL TCP-wrappers TermReadKey -Texinfo-exception +TGPPL-1.0 +threeparttable TMate TORQUE-1.1 TOSL TPDL TPL-1.0 +TrustedQSL TTWL TTYP0 TU-Berlin-1.0 TU-Berlin-2.0 +Ubuntu-font-1.0 UCAR UCL-1.0 ulem +UMich-Merit +Unicode-3.0 Unicode-DFS-2015 Unicode-DFS-2016 Unicode-TOU @@ -577,15 +643,18 @@ WTFPL wxWindows X11 X11-distribute-modifications-variant +X11-swapped Xdebug-1.03 Xerox Xfig XFree86-1.1 xinetd +xkeyboard-config-Zinoviev xlock Xnet xpp XSkat +xzoom YPL-1.0 YPL-1.1 Zed diff --git a/anaconda_linter/lint/check_build_help.py b/anaconda_linter/lint/check_build_help.py index d83e1b3f..17fc756e 100644 --- a/anaconda_linter/lint/check_build_help.py +++ b/anaconda_linter/lint/check_build_help.py @@ -2,6 +2,7 @@ File: check_build_help.py Description: Contains linter checks for build section based rules. """ + from __future__ import annotations import os @@ -51,6 +52,11 @@ "setuptools-rust", "setuptools_scm", "whey", + "scikit-build-core", + "scikit-build", + "maturin", + "python-build", + "build", ) # List of known PEP-517 backends (https://peps.python.org/pep-0517/) that are not setuptools @@ -70,6 +76,7 @@ "poetry-core", # Backend of poetry. "scikit-build-core", # Backend that uses cmake. "whey", + "maturin", ) COMPILERS = ( diff --git a/anaconda_linter/lint/check_url.py b/anaconda_linter/lint/check_url.py index 01590381..ff6bfbcc 100644 --- a/anaconda_linter/lint/check_url.py +++ b/anaconda_linter/lint/check_url.py @@ -2,6 +2,7 @@ File: check_url.py Description: Contains linter checks for URL validation. """ + from __future__ import annotations from anaconda_linter import utils @@ -37,7 +38,12 @@ def check_recipe(self, recipe) -> None: if url: response_data = utils.check_url(url) if response_data["code"] < 0 or response_data["code"] >= 400: - severity = Severity.INFO if "domain_redirect" in response_data else Severity.ERROR + if "domain_redirect" in response_data: + severity = Severity.INFO + elif response_data["code"] == 403: + severity = Severity.WARNING + else: + severity = Severity.ERROR self.message(url, response_data["message"], section=url_field, severity=severity) diff --git a/tests/lint/test_build_help.py b/tests/lint/test_build_help.py index e73f8976..04b8d36e 100644 --- a/tests/lint/test_build_help.py +++ b/tests/lint/test_build_help.py @@ -18,7 +18,7 @@ def test_host_section_needs_exact_pinnings_good(base_yaml: str) -> None: + """ requirements: host: - - maturin 0.13.7 + - mydep 0.13.7 """ ) lint_check = "host_section_needs_exact_pinnings" @@ -34,11 +34,11 @@ def test_host_section_needs_exact_pinnings_good_multi(base_yaml: str) -> None: - name: output1 requirements: host: - - maturin 0.13.7 + - mydep 0.13.7 - name: output2 requirements: host: - - maturin 0.13.7 + - mydep 0.13.7 """ ) lint_check = "host_section_needs_exact_pinnings" @@ -88,11 +88,11 @@ def test_host_section_needs_exact_pinnings_good_cbc(base_yaml: str, recipe_dir: + """ requirements: host: - - maturin + - mydep """ ) cbc = """ - maturin: + mydep: - 0.13.7 """ cbc_file = recipe_dir / "conda_build_config.yaml" @@ -130,15 +130,15 @@ def test_host_section_needs_exact_pinnings_good_cbc_multi(base_yaml: str, recipe - name: output1 requirements: host: - - maturin + - mydep - name: output2 requirements: host: - - maturin + - mydep """ ) cbc = """ - maturin: + mydep: - 0.13.7 """ cbc_file = recipe_dir / "conda_build_config.yaml" @@ -155,7 +155,7 @@ def test_host_section_needs_exact_pinnings_bad(base_yaml: str, constraint: str) + f""" requirements: host: - - maturin {constraint} + - mydep {constraint} """ ) lint_check = "host_section_needs_exact_pinnings" @@ -172,11 +172,11 @@ def test_host_section_needs_exact_pinnings_bad_multi(base_yaml: str, constraint: - name: output1 requirements: host: - - maturin {constraint} + - mydep {constraint} - name: output2 requirements: host: - - maturin {constraint} + - mydep {constraint} """ ) lint_check = "host_section_needs_exact_pinnings"