Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-flit for openSUSE:Factory checked in at 2022-11-09 12:56:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flit (Old) and /work/SRC/openSUSE:Factory/.python-flit.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flit" Wed Nov 9 12:56:51 2022 rev:6 rq:1034498 version:3.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flit/python-flit.changes 2022-03-28 19:24:34.565037679 +0200 +++ /work/SRC/openSUSE:Factory/.python-flit.new.1597/python-flit.changes 2022-11-09 12:57:11.968268101 +0100 @@ -1,0 +2,25 @@ +Tue Nov 8 10:20:01 UTC 2022 - Ben Greiner <c...@bnavigator.de> + +- Fix dependencies + +------------------------------------------------------------------- +Tue Nov 8 00:29:24 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 3.8 + A project name containing hyphens is now automatically translated to use underscores for the import name (PR #566). + New option flit install --only-deps to install the dependencies of the package, but not the package itself. + Add support for recursive globbing (**) in sdist includes and excludes (PR #550). + Python???s bytecode cache files (__pycache__ folders and .pyc files) are now always excluded from sdists (PR #581). + Use tomllib in Python 3.11, rather than tomli (PR #573, PR #604). + Fix crash when unable to get a password from keyring (PR #567). + Fix including modified files in sdist when using Mercurial (PR #541). + Fix for some cases of determining whether a package supports Python 2 or not (PR #593). + Fix parsing version number from code using multiple assignments (PR #474). + Document how to use a PyPI token with FLIT_PASSWORD (PR #602). + Fix link to information about environment variables for pip (PR #576). + Link to the docs for the latest stable version in package metadata (PR #589). + Remove a mention of the toml package, which is no longer needed, from the Developing Flit page (PR #601). + The bootstrap install script for flit_core accepts a new --install-root option. + Ensure the license file is included in packages on PyPI (PR #603). + +------------------------------------------------------------------- Old: ---- flit-3.7.1.tar.gz New: ---- flit-3.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flit.spec ++++++ --- /var/tmp/diff_new_pack.zuyoP9/_old 2022-11-09 12:57:14.408281856 +0100 +++ /var/tmp/diff_new_pack.zuyoP9/_new 2022-11-09 12:57:14.412281879 +0100 @@ -16,34 +16,32 @@ # -%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-flit -Version: 3.7.1 +Version: 3.8.0 Release: 0 Summary: Simplified packaging of Python modules License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/pypa/flit Source: https://files.pythonhosted.org/packages/source/f/flit/flit-%{version}.tar.gz -BuildRequires: %{python_module base > 3.6} +BuildRequires: %{python_module base >= 3.6} BuildRequires: %{python_module docutils} -BuildRequires: %{python_module flit-core >= 3.7.1} +BuildRequires: %{python_module flit-core >= 3.8.0} BuildRequires: %{python_module pip} BuildRequires: %{python_module requests} BuildRequires: %{python_module tomli-w} -BuildRequires: %{python_module tomli} # SECTION test requirements BuildRequires: %{python_module testpath} BuildRequires: %{python_module pytest >= 2.7.3} BuildRequires: %{python_module responses} +BuildRequires: %{python_module tomli} # /SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-docutils -Requires: python-flit-core +Requires: python-flit-core >= 3.8.0 Requires: python-requests -Requires: python-tomli Requires: python-tomli-w Requires(post): update-alternatives Requires(postun):update-alternatives ++++++ flit-3.7.1.tar.gz -> flit-3.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/.bumpversion.cfg new/flit-3.8.0/.bumpversion.cfg --- old/flit-3.7.1/.bumpversion.cfg 2022-02-23 12:35:47.110032300 +0100 +++ new/flit-3.8.0/.bumpversion.cfg 2022-11-05 14:06:27.383138400 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.7.1 +current_version = 3.8.0 commit = True tag = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/.github/dependabot.yml new/flit-3.8.0/.github/dependabot.yml --- old/flit-3.7.1/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.8.0/.github/dependabot.yml 2022-11-05 13:52:43.628104400 +0100 @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/.github/workflows/test.yml new/flit-3.8.0/.github/workflows/test.yml --- old/flit-3.7.1/.github/workflows/test.yml 2022-02-21 19:53:07.973436000 +0100 +++ new/flit-3.8.0/.github/workflows/test.yml 2022-11-05 13:52:43.628104400 +0100 @@ -19,12 +19,12 @@ strategy: matrix: platform: ["ubuntu-latest", "windows-latest"] - python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev" ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/PKG-INFO new/flit-3.8.0/PKG-INFO --- old/flit-3.7.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.8.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: flit -Version: 3.7.1 +Version: 3.8.0 Summary: A simple packaging tool for simple packages. Author-email: Thomas Kluyver <tho...@kluyver.me.uk> Requires-Python: >=3.6 @@ -9,10 +9,9 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Software Development :: Libraries :: Python Modules -Requires-Dist: flit_core >=3.7.1 +Requires-Dist: flit_core >=3.8.0 Requires-Dist: requests Requires-Dist: docutils -Requires-Dist: tomli Requires-Dist: tomli-w Requires-Dist: sphinx ; extra == "doc" Requires-Dist: sphinxcontrib_github_alt ; extra == "doc" @@ -21,8 +20,9 @@ Requires-Dist: responses ; extra == "test" Requires-Dist: pytest>=2.7.3 ; extra == "test" Requires-Dist: pytest-cov ; extra == "test" -Project-URL: Changelog, https://flit.readthedocs.io/en/latest/history.html -Project-URL: Documentation, https://flit.readthedocs.io/en/latest/ +Requires-Dist: tomli ; extra == "test" +Project-URL: Changelog, https://flit.pypa.io/en/stable/history.html +Project-URL: Documentation, https://flit.pypa.io Project-URL: Source, https://github.com/pypa/flit Provides-Extra: doc Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/doc/cmdline.rst new/flit-3.8.0/doc/cmdline.rst --- old/flit-3.7.1/doc/cmdline.rst 2021-12-06 15:34:44.136786200 +0100 +++ new/flit-3.8.0/doc/cmdline.rst 2022-11-05 14:06:10.847054700 +0100 @@ -137,6 +137,15 @@ install all optional dependencies, or a comma-separated list of extras. Default depends on ``--deps``. +.. option:: --only-deps + + Install the dependencies of this package, but not the package itself. + + This can be useful for e.g. building a container image, where your own code + is copied or mounted into the container at a later stage. + + .. versionadded:: 3.8 + .. option:: --user Do a user-local installation. This is the default if flit is not in a @@ -163,7 +172,7 @@ Flit calls pip to do the installation. You can set any of pip's options `using its environment variables - <https://pip.pypa.io/en/stable/user_guide/#environment-variables>`__. + <https://pip.pypa.io/en/stable/topics/configuration/#environment-variables>`__. When you use the :option:`--symlink` or :option:`--pth-file` options, pip is used to install dependencies. Otherwise, Flit builds a wheel and then @@ -207,6 +216,10 @@ Set a username, password, and index URL for uploading packages. See :ref:`uploading packages with environment variables <upload_envvars>` for more information. + + Token-based upload to PyPI is supported. To upload using a PyPI token, + set ``FLIT_USERNAME`` to ``__token__``, and ``FLIT_PASSWORD`` to the + token value. .. envvar:: FLIT_ALLOW_INVALID diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/doc/conf.py new/flit-3.8.0/doc/conf.py --- old/flit-3.7.1/doc/conf.py 2022-02-23 12:35:47.109032400 +0100 +++ new/flit-3.8.0/doc/conf.py 2022-11-05 14:06:27.383138400 +0100 @@ -57,7 +57,7 @@ # built documents. # # The short X.Y version. -version = '3.7.1' +version = '3.8.0' # The full version, including alpha/beta/rc tags. release = version #+ '.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/doc/development.rst new/flit-3.8.0/doc/development.rst --- old/flit-3.7.1/doc/development.rst 2021-12-06 15:34:44.136786200 +0100 +++ new/flit-3.8.0/doc/development.rst 2022-11-05 13:52:43.628104400 +0100 @@ -5,7 +5,7 @@ git clone https://github.com/pypa/flit.git cd flit - python3 -m pip install docutils requests toml + python3 -m pip install docutils requests python3 bootstrap_dev.py This links Flit into the current Python environment, so you can make changes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/doc/history.rst new/flit-3.8.0/doc/history.rst --- old/flit-3.7.1/doc/history.rst 2022-02-23 12:35:15.229898500 +0100 +++ new/flit-3.8.0/doc/history.rst 2022-11-05 14:06:10.847054700 +0100 @@ -1,6 +1,33 @@ Release history =============== +Version 3.8 +----------- + +- A project name containing hyphens is now automatically translated to use + underscores for the import name (:ghpull:`566`). +- New option :option:`flit install --only-deps` to install the dependencies of + the package, but not the package itself. +- Add support for recursive globbing (``**``) in sdist includes and excludes + (:ghpull:`550`). +- Python's bytecode cache files (``__pycache__`` folders and ``.pyc`` files) + are now always excluded from sdists (:ghpull:`581`). +- Use tomllib in Python 3.11, rather than tomli (:ghpull:`573`, :ghpull:`604`). +- Fix crash when unable to get a password from ``keyring`` (:ghpull:`567`). +- Fix including modified files in sdist when using Mercurial (:ghpull:`541`). +- Fix for some cases of determining whether a package supports Python 2 or not + (:ghpull:`593`). +- Fix parsing version number from code using multiple assignments (:ghpull:`474`). +- Document how to use a PyPI token with :envvar:`FLIT_PASSWORD` (:ghpull:`602`). +- Fix link to information about environment variables for pip (:ghpull:`576`). +- Link to the docs for the latest stable version in package metadata + (:ghpull:`589`). +- Remove a mention of the ``toml`` package, which is no longer needed, from the + :doc:`development` page (:ghpull:`601`). +- The :doc:`bootstrap <bootstrap>` install script for ``flit_core`` accepts a + new ``--install-root`` option. +- Ensure the license file is included in packages on PyPI (:ghpull:`603`). + Version 3.7.1 ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/doc/pyproject_toml.rst new/flit-3.8.0/doc/pyproject_toml.rst --- old/flit-3.7.1/doc/pyproject_toml.rst 2022-02-22 12:13:30.008365600 +0100 +++ new/flit-3.8.0/doc/pyproject_toml.rst 2022-11-05 14:06:10.848055000 +0100 @@ -69,8 +69,13 @@ name The name your package will have on PyPI. This field is required. For Flit, - this also points to your package as an import name by default (see - :ref:`pyproject_module` if that needs to be different). + this name, with any hyphens replaced by underscores, is also the default value + of the import name (see :ref:`pyproject_module` if that needs to be + different). + + .. versionchanged:: 3.8 + Hyphens in the project name are now translated to underscores for the + import name. version Version number as a string. If you want Flit to get this from a ``__version__`` attribute, leave it out of the TOML config and include @@ -164,7 +169,7 @@ .. code-block:: toml [project.urls] - Documentation = "https://flit.readthedocs.io/en/latest/" + Documentation = "https://flit.pypa.io" Source = "https://github.com/pypa/flit" .. _pyproject_project_scripts: @@ -233,6 +238,10 @@ [tool.flit.module] name = "nsist" +Flit looks for the source of the package by its import name. The source may be +located either in the directory that holds the ``pyproject.toml`` file, or in a +``src/`` subdirectory. + .. _pyproject_old_metadata: Old style metadata @@ -364,7 +373,7 @@ .. code-block:: toml [tool.flit.metadata.urls] - Documentation = "https://flit.readthedocs.io/en/latest/" + Documentation = "https://flit.pypa.io" .. versionadded:: 1.0 @@ -409,13 +418,16 @@ - Must be relative paths from the directory containing ``pyproject.toml`` - Cannot go outside that directory (no ``../`` paths) - Cannot contain control characters or ``<>:"\\`` -- Cannot use recursive glob patterns (``**/``) - Can refer to directories, in which case they include everything under the directory, including subdirectories - Should match the case of the files they refer to, as case-insensitive matching is platform dependent -Exclusions have priority over inclusions. +.. versionchanged:: 3.8 + Include and exclude patterns can now use recursive glob patterns (``**``). + +Exclusions have priority over inclusions. Bytecode is excluded by default and cannot +be included. .. note:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit/__init__.py new/flit-3.8.0/flit/__init__.py --- old/flit-3.7.1/flit/__init__.py 2022-02-23 12:35:47.108032500 +0100 +++ new/flit-3.8.0/flit/__init__.py 2022-11-05 14:06:27.381138300 +0100 @@ -12,7 +12,7 @@ from .config import ConfigError from .log import enable_colourful_output -__version__ = '3.7.1' +__version__ = '3.8.0' log = logging.getLogger(__name__) @@ -57,7 +57,17 @@ parser.add_argument('--python', help="Target Python executable, if different from the one running flit" ) - + parser.add_argument('--deps', choices=['all', 'production', 'develop', 'none'], default='all', + help="Which set of dependencies to install. If --deps=develop, the extras dev, doc, and test are installed" + ) + parser.add_argument('--only-deps', action='store_true', + help="Install only dependencies of this package, and not the package itself" + ) + parser.add_argument('--extras', default=(), type=lambda l: l.split(',') if l else (), + help="Install the dependencies of these (comma separated) extras additionally to the ones implied by --deps. " + "--extras=all can be useful in combination with --deps=production, --deps=none precludes using --extras" + ) + def main(argv=None): ap = argparse.ArgumentParser() @@ -134,13 +144,6 @@ help="Add .pth file for the module/package to site packages instead of copying it" ) add_shared_install_options(parser_install) - parser_install.add_argument('--deps', choices=['all', 'production', 'develop', 'none'], default='all', - help="Which set of dependencies to install. If --deps=develop, the extras dev, doc, and test are installed" - ) - parser_install.add_argument('--extras', default=(), type=lambda l: l.split(',') if l else (), - help="Install the dependencies of these (comma separated) extras additionally to the ones implied by --deps. " - "--extras=all can be useful in combination with --deps=production, --deps=none precludes using --extras" - ) # flit init -------------------------------------------- parser_init = subparsers.add_parser('init', @@ -189,9 +192,19 @@ from .install import Installer try: python = find_python_executable(args.python) - Installer.from_ini_path(args.ini_file, user=args.user, python=python, - symlink=args.symlink, deps=args.deps, extras=args.extras, - pth=args.pth_file).install() + installer = Installer.from_ini_path( + args.ini_file, + user=args.user, + python=python, + symlink=args.symlink, + deps=args.deps, + extras=args.extras, + pth=args.pth_file + ) + if args.only_deps: + installer.install_requirements() + else: + installer.install() except (ConfigError, PythonNotFoundError, common.NoDocstringError, common.NoVersionError) as e: sys.exit(e.args[0]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit/upload.py new/flit-3.8.0/flit/upload.py --- old/flit-3.7.1/flit/upload.py 2021-11-14 15:34:30.345272500 +0100 +++ new/flit-3.8.0/flit/upload.py 2022-11-05 13:52:43.629104400 +0100 @@ -145,14 +145,17 @@ return repo['password'] try: - import keyring + import keyring, keyring.errors except ImportError: # pragma: no cover log.warning("Install keyring to store passwords securely") keyring = None else: - stored_pw = keyring.get_password(repo['url'], repo['username']) - if stored_pw is not None: - return stored_pw + try: + stored_pw = keyring.get_password(repo['url'], repo['username']) + if stored_pw is not None: + return stored_pw + except keyring.errors.KeyringError as e: + log.warning("Could not get password from keyring (%s)", e) if sys.stdin.isatty(): pw = None @@ -164,8 +167,11 @@ raise Exception("Could not find password for upload.") if keyring is not None: - keyring.set_password(repo['url'], repo['username'], pw) - log.info("Stored password with keyring") + try: + keyring.set_password(repo['url'], repo['username'], pw) + log.info("Stored password with keyring") + except keyring.errors.KeyringError as e: + log.warning("Could not store password in keyring (%s)", e) return pw diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit/vcs/hg.py new/flit-3.8.0/flit/vcs/hg.py --- old/flit-3.7.1/flit/vcs/hg.py 2021-11-14 15:34:30.346272500 +0100 +++ new/flit-3.8.0/flit/vcs/hg.py 2022-11-05 13:52:43.629104400 +0100 @@ -21,7 +21,7 @@ def list_tracked_files(directory): - outb = check_output(['hg', 'status', '--clean', '--added', '--no-status'], + outb = check_output(['hg', 'status', '--clean', '--added', '--modified', '--no-status'], cwd=str(directory)) paths = [os.fsdecode(l) for l in outb.strip().splitlines()] return _repo_paths_to_directory_paths(paths, directory) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/LICENSE new/flit-3.8.0/flit_core/LICENSE --- old/flit-3.7.1/flit_core/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.8.0/flit_core/LICENSE 2022-11-05 13:52:43.629104400 +0100 @@ -0,0 +1,29 @@ +Copyright (c) 2015, Thomas Kluyver and contributors +All rights reserved. + +BSD 3-clause license: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/bootstrap_install.py new/flit-3.8.0/flit_core/bootstrap_install.py --- old/flit-3.7.1/flit_core/bootstrap_install.py 2022-02-21 20:04:37.818999300 +0100 +++ new/flit-3.8.0/flit_core/bootstrap_install.py 2022-11-05 13:52:43.629104400 +0100 @@ -37,12 +37,21 @@ default=purelib, help=f'installdir directory (defaults to {purelib})', ) + parser.add_argument( + '--install-root', + type=Path, + default=None, + help='if given, installdir is considered to be under this' + ) args = parser.parse_args() if not args.wheel.name.startswith('flit_core-'): sys.exit("Use this script only for flit_core wheels") - if not args.installdir.is_dir(): - sys.exit(f"{args.installdir} is not a directory") + if args.install_root: + installdir = args.install_root / args.installdir.relative_to("/") + else: + installdir = args.installdir - extract_wheel(args.wheel, args.installdir) + installdir.mkdir(parents=True, exist_ok=True) + extract_wheel(args.wheel, installdir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/__init__.py new/flit-3.8.0/flit_core/flit_core/__init__.py --- old/flit-3.7.1/flit_core/flit_core/__init__.py 2022-02-23 12:35:47.109032400 +0100 +++ new/flit-3.8.0/flit_core/flit_core/__init__.py 2022-11-05 14:06:27.382138300 +0100 @@ -4,4 +4,4 @@ All the convenient development features live in the main 'flit' package. """ -__version__ = '3.7.1' +__version__ = '3.8.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/common.py new/flit-3.8.0/flit_core/flit_core/common.py --- old/flit-3.7.1/flit_core/flit_core/common.py 2022-02-23 12:35:15.232898500 +0100 +++ new/flit-3.8.0/flit_core/flit_core/common.py 2022-11-05 13:52:43.629104400 +0100 @@ -135,9 +135,11 @@ # string assignment to __version__ is_version_str = ( isinstance(child, ast.Assign) - and len(child.targets) == 1 - and isinstance(child.targets[0], ast.Name) - and child.targets[0].id == "__version__" + and any( + isinstance(target, ast.Name) + and target.id == "__version__" + for target in child.targets + ) and isinstance(child.value, ast.Str) ) if is_version_str: @@ -398,7 +400,7 @@ def supports_py2(self): """Return True if Requires-Python indicates Python 2 support.""" for part in (self.requires_python or "").split(","): - if re.search(r"^\s*(>\s*(=\s*)?)?[3-9]", part): + if re.search(r"^\s*(>=?|~=|===?)?\s*[3-9]", part): return False return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/config.py new/flit-3.8.0/flit_core/flit_core/config.py --- old/flit-3.7.1/flit_core/flit_core/config.py 2022-02-21 19:53:07.976436100 +0100 +++ new/flit-3.8.0/flit_core/flit_core/config.py 2022-11-05 13:52:43.630104300 +0100 @@ -7,7 +7,16 @@ from pathlib import Path import re -from .vendor import tomli +try: + import tomllib +except ImportError: + try: + from .vendor import tomli as tomllib + # Some downstream distributors remove the vendored tomli. + # When that is removed, import tomli from the regular location. + except ImportError: + import tomli as tomllib + from .versionno import normalise_version log = logging.getLogger(__name__) @@ -66,7 +75,7 @@ def read_flit_config(path): """Read and check the `pyproject.toml` file with data about the package. """ - d = tomli.loads(path.read_text('utf-8')) + d = tomllib.loads(path.read_text('utf-8')) return prep_toml_config(d, path) @@ -138,8 +147,12 @@ loaded_cfg.sdist_include_patterns = _check_glob_patterns( dtool['sdist'].get('include', []), 'include' ) + exclude = [ + "**/__pycache__", + "**.pyc", + ] + dtool['sdist'].get('exclude', []) loaded_cfg.sdist_exclude_patterns = _check_glob_patterns( - dtool['sdist'].get('exclude', []), 'exclude' + exclude, 'exclude' ) data_dir = dtool.get('external-data', {}).get('directory', None) @@ -216,11 +229,6 @@ '{} pattern {!r} contains bad characters (<>:\"\\ or control characters)' .format(clude, p) ) - if '**' in p: - raise ConfigError( - "Recursive globbing (**) is not supported yet (in {} pattern {!r})" - .format(clude, p) - ) normp = osp.normpath(p) @@ -426,7 +434,8 @@ if 'name' not in proj: raise ConfigError('name must be specified in [project] table') _check_type(proj, 'name', str) - lc.module = md_dict['name'] = proj['name'] + md_dict['name'] = proj['name'] + lc.module = md_dict['name'].replace('-', '_') unexpected_keys = proj.keys() - pep621_allowed_fields if unexpected_keys: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/sdist.py new/flit-3.8.0/flit_core/flit_core/sdist.py --- old/flit-3.7.1/flit_core/flit_core/sdist.py 2022-02-21 19:53:07.977436000 +0100 +++ new/flit-3.8.0/flit_core/flit_core/sdist.py 2022-11-05 13:52:43.630104300 +0100 @@ -43,7 +43,7 @@ self.files = set() for pattern in patterns: - for path in sorted(glob(osp.join(basedir, pattern))): + for path in sorted(glob(osp.join(basedir, pattern), recursive=True)): rel = osp.relpath(path, basedir) if osp.isdir(path): self.dirs.add(rel) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/samples/inclusion/pyproject.toml new/flit-3.8.0/flit_core/flit_core/tests/samples/inclusion/pyproject.toml --- old/flit-3.7.1/flit_core/flit_core/tests/samples/inclusion/pyproject.toml 2021-11-14 15:34:30.348272600 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/samples/inclusion/pyproject.toml 2022-11-05 13:52:43.630104300 +0100 @@ -9,4 +9,4 @@ [tool.flit.sdist] include = ["doc"] -exclude = ["doc/*.txt"] +exclude = ["doc/*.txt", "doc/**/*.md"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/samples/moduleunimportabledouble.py new/flit-3.8.0/flit_core/flit_core/tests/samples/moduleunimportabledouble.py --- old/flit-3.7.1/flit_core/flit_core/tests/samples/moduleunimportabledouble.py 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/samples/moduleunimportabledouble.py 2022-11-05 13:52:43.630104300 +0100 @@ -0,0 +1,8 @@ + +""" +A sample unimportable module with double assignment +""" + +raise ImportError() + +VERSION = __version__ = "0.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/samples/normalization/pyproject.toml new/flit-3.8.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml --- old/flit-3.7.1/flit_core/flit_core/tests/samples/normalization/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml 2022-11-05 13:52:43.630104300 +0100 @@ -0,0 +1,14 @@ +[build-system] +requires = ["flit_core >=3.8,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "my-python-module" +version = "0.0.1" +description = "Hyphenated package name, infered import name" +authors = [ + {name = "Sir Robin", email = "ro...@camelot.uk"} +] + +[project.urls] +homepage = "http://github.com/me/python-module" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/test_common.py new/flit-3.8.0/flit_core/flit_core/tests/test_common.py --- old/flit-3.7.1/flit_core/flit_core/tests/test_common.py 2022-02-23 12:35:15.233898400 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/test_common.py 2022-11-05 13:52:43.630104300 +0100 @@ -70,6 +70,11 @@ 'version': '0.1'} ) + info = get_info_from_module(Module('moduleunimportabledouble', samples_dir)) + self.assertEqual(info, {'summary': 'A sample unimportable module with double assignment', + 'version': '0.1'} + ) + info = get_info_from_module(Module('module1', samples_dir / 'constructed_version')) self.assertEqual(info, {'summary': 'This module has a __version__ that requires runtime interpretation', 'version': '1.2.3'} @@ -113,6 +118,9 @@ ("<4, > 3.2", False), (">3.4", False), (">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", True), + ("== 3.9", False), + ("~=2.7", True), + ("~=3.9", False), ], ) def test_supports_py2(requires_python, expected_result): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/test_config.py new/flit-3.8.0/flit_core/flit_core/tests/test_config.py --- old/flit-3.7.1/flit_core/flit_core/tests/test_config.py 2021-11-18 23:10:43.578393000 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/test_config.py 2022-11-05 13:52:43.630104300 +0100 @@ -20,6 +20,11 @@ assert inf.module == 'ns1.pkg' assert inf.metadata['home_page'] == 'http://github.com/sirrobin/module1' +def test_load_normalization(): + inf = config.read_flit_config(samples_dir / 'normalization' / 'pyproject.toml') + assert inf.module == 'my_python_module' + assert inf.metadata['name'] == 'my-python-module' + def test_load_pep621(): inf = config.read_flit_config(samples_dir / 'pep621' / 'pyproject.toml') assert inf.module == 'module1a' @@ -108,7 +113,6 @@ ('foo/../../bar', 'out of the directory'), ('/home', 'absolute path'), ('foo:bar', 'bad character'), - ('foo/**/bar', '[Rr]ecursive glob') ]) def test_bad_include_paths(path, err_match): toml_cfg = {'tool': {'flit': { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/flit_core/tests/test_sdist.py new/flit-3.8.0/flit_core/flit_core/tests/test_sdist.py --- old/flit-3.7.1/flit_core/flit_core/tests/test_sdist.py 2022-02-21 19:53:07.978436000 +0100 +++ new/flit-3.8.0/flit_core/flit_core/tests/test_sdist.py 2022-11-05 13:52:43.631104500 +0100 @@ -49,6 +49,7 @@ assert osp.join('doc', 'test.rst') in files assert osp.join('doc', 'test.txt') not in files assert osp.join('doc', 'subdir', 'test.txt') in files + assert osp.join('doc', 'subdir', 'subsubdir', 'test.md') not in files def test_data_dir(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/flit_core/pyproject.toml new/flit-3.8.0/flit_core/pyproject.toml --- old/flit-3.7.1/flit_core/pyproject.toml 2022-02-21 20:04:37.819999200 +0100 +++ new/flit-3.8.0/flit_core/pyproject.toml 2022-11-05 13:52:43.631104500 +0100 @@ -11,6 +11,7 @@ description = "Distribution-building parts of Flit. See flit package for more information" dependencies = [] requires-python = '>=3.6' +license = {file = "LICENSE"} classifiers = [ "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries :: Python Modules", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/pyproject.toml new/flit-3.8.0/pyproject.toml --- old/flit-3.7.1/pyproject.toml 2022-02-23 12:35:47.107032300 +0100 +++ new/flit-3.8.0/pyproject.toml 2022-11-05 14:06:27.381138300 +0100 @@ -1,5 +1,5 @@ [build-system] -requires = ["flit_core >=3.7.1,<4"] +requires = ["flit_core >=3.8.0,<4"] build-backend = "flit_core.buildapi" [project] @@ -8,14 +8,14 @@ {name = "Thomas Kluyver", email = "tho...@kluyver.me.uk"}, ] dependencies = [ - "flit_core >=3.7.1", + "flit_core >=3.8.0", "requests", "docutils", - "tomli", "tomli-w", ] requires-python = ">=3.6" readme = "README.rst" +license = {file = "LICENSE"} classifiers = ["Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", @@ -29,6 +29,7 @@ "responses", "pytest>=2.7.3", "pytest-cov", + "tomli", ] doc = [ "sphinx", @@ -37,9 +38,9 @@ ] [project.urls] -Documentation = "https://flit.readthedocs.io/en/latest/" +Documentation = "https://flit.pypa.io" Source = "https://github.com/pypa/flit" -Changelog = "https://flit.readthedocs.io/en/latest/history.html" +Changelog = "https://flit.pypa.io/en/stable/history.html" [project.scripts] flit = "flit:main" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/tests/test_init.py new/flit-3.8.0/tests/test_init.py --- old/flit-3.7.1/tests/test_init.py 2021-11-14 15:34:30.353272400 +0100 +++ new/flit-3.8.0/tests/test_init.py 2022-11-05 14:06:10.848055000 +0100 @@ -6,7 +6,10 @@ from unittest.mock import patch import pytest -import tomli +try: + import tomllib +except ImportError: + import tomli as tomllib from flit import init @@ -107,7 +110,7 @@ generated = Path(td) / 'pyproject.toml' assert_isfile(generated) with generated.open('rb') as f: - data = tomli.load(f) + data = tomllib.load(f) assert data['project']['authors'][0]['email'] == "t...@example.com" license = Path(td) / 'LICENSE' assert data['project']['license']['file'] == 'LICENSE' @@ -131,7 +134,7 @@ ti = init.TerminalIniter(td) ti.initialise() with Path(td, 'pyproject.toml').open('rb') as f: - data = tomli.load(f) + data = tomllib.load(f) assert not Path(td, 'LICENSE').exists() assert data['project'] == { 'authors': [{'name': 'Test Author', 'email': 'test_em...@example.com'}], @@ -153,7 +156,7 @@ ti = init.TerminalIniter(td) ti.initialise() with Path(td, 'pyproject.toml').open('rb') as f: - data = tomli.load(f) + data = tomllib.load(f) assert data['project'] == { 'authors': [{'name': 'Test Author', 'email': 'test_em...@example.com'}], 'name': 'test_module_name', @@ -174,7 +177,7 @@ ti = init.TerminalIniter(td) ti.initialise() with Path(td, 'pyproject.toml').open('rb') as f: - data = tomli.load(f) + data = tomllib.load(f) assert not Path(td, 'LICENSE').exists() assert data['project'] == { @@ -215,7 +218,7 @@ ti = init.TerminalIniter(td) ti.initialise() with Path(td, 'pyproject.toml').open('rb') as f: - data = tomli.load(f) + data = tomllib.load(f) assert data['project'] == { 'authors': [{'name': 'Test Author', 'email': 'test_em...@example.com'}], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/tests/test_tomlify.py new/flit-3.8.0/tests/test_tomlify.py --- old/flit-3.7.1/tests/test_tomlify.py 2021-11-14 15:34:30.354272600 +0100 +++ new/flit-3.8.0/tests/test_tomlify.py 2022-11-05 13:52:43.631104500 +0100 @@ -1,6 +1,9 @@ import os from pathlib import Path -import tomli +try: + import tomllib +except ImportError: + import tomli as tomllib from shutil import copy from testpath import assert_isfile @@ -18,7 +21,7 @@ assert_isfile(pyproject_toml) with pyproject_toml.open('rb') as f: - content = tomli.load(f) + content = tomllib.load(f) assert 'build-system' in content assert 'tool' in content diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/tests/test_upload.py new/flit-3.8.0/tests/test_upload.py --- old/flit-3.7.1/tests/test_upload.py 2021-11-14 15:34:30.354272600 +0100 +++ new/flit-3.8.0/tests/test_upload.py 2022-11-05 13:52:43.631104500 +0100 @@ -77,21 +77,19 @@ @contextmanager def _fake_keyring(pw): - real_keyring = sys.modules.get('keyring', None) class FakeKeyring: @staticmethod def get_password(service_name, username): return pw - sys.modules['keyring'] = FakeKeyring() + class FakeKeyringErrMod: + class KeyringError(Exception): + pass - try: + with patch.dict('sys.modules', { + 'keyring': FakeKeyring(), 'keyring.errors': FakeKeyringErrMod(), + }): yield - finally: - if real_keyring is None: - del sys.modules['keyring'] - else: - sys.modules['keyring'] = real_keyring pypirc2 = """ [distutils] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.7.1/tox.ini new/flit-3.8.0/tox.ini --- old/flit-3.7.1/tox.ini 2022-01-15 14:08:55.119355700 +0100 +++ new/flit-3.8.0/tox.ini 2022-11-05 13:52:43.632104400 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = py{310,39,38,37,36},bootstrap +envlist = py{311,310,39,38,37,36},bootstrap skip_missing_interpreters = true [gh-actions] @@ -9,6 +9,7 @@ 3.8: py38, bootstrap 3.9: py39 3.10: py310 + 3.11: py311 [testenv] deps = @@ -16,7 +17,7 @@ testpath responses docutils - tomli + tomli;python_version < "3.11" tomli-w pytest>=2.7.3 pytest-cov