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 2023-09-08 21:15:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flit (Old) and /work/SRC/openSUSE:Factory/.python-flit.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flit" Fri Sep 8 21:15:22 2023 rev:12 rq:1109506 version:3.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flit/python-flit.changes 2023-08-11 15:55:04.447598569 +0200 +++ /work/SRC/openSUSE:Factory/.python-flit.new.1766/python-flit.changes 2023-09-08 21:16:03.391575997 +0200 @@ -1,0 +2,22 @@ +Thu Sep 7 10:50:43 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 3.9.0: + * New options :option:`flit build --use-vcs` and :option:`flit + build --no-use-vcs` to enable & disable including all + committed files in the sdist. For now --use-vcs is the + default, but this is likely to change in a + future version, to bring flit build in line with standard + build frontends like python -m build + * Sdist file names, and the name of the top-level folder in an + sdist, are now normalised, in accordance with PEP 625 + * A statically defined version number can now be parsed from + files called version.py, _version.py or __version__.py inside + a packge, as well as from __init__.py, so executing code is + required in fewer cases + * Fix setting the flag for regular files in zip metadata + * The timestamp embedded in the gzip wrapper for sdists now + defaults to a fixed date, so building an sdist twice on the + same machine should produce identical results, even without + any special steps. + +------------------------------------------------------------------- Old: ---- flit-3.8.0.tar.gz New: ---- flit-3.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flit.spec ++++++ --- /var/tmp/diff_new_pack.cmcPQ8/_old 2023-09-08 21:16:04.819627035 +0200 +++ /var/tmp/diff_new_pack.cmcPQ8/_new 2023-09-08 21:16:04.839627749 +0200 @@ -19,7 +19,7 @@ %define skip_python2 1 %{?sle15_python_module_pythons} Name: python-flit -Version: 3.8.0 +Version: 3.9.0 Release: 0 Summary: Simplified packaging of Python modules License: BSD-3-Clause @@ -28,14 +28,14 @@ Source: https://files.pythonhosted.org/packages/source/f/flit/flit-%{version}.tar.gz BuildRequires: %{python_module base >= 3.6} BuildRequires: %{python_module docutils} -BuildRequires: %{python_module flit-core >= 3.8.0} +BuildRequires: %{python_module flit-core >= %{version}} BuildRequires: %{python_module pip} BuildRequires: %{python_module requests} BuildRequires: %{python_module tomli-w} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-docutils -Requires: python-flit-core >= 3.8.0 +Requires: python-flit-core >= %{version} Requires: python-requests Requires: python-tomli-w Requires(post): update-alternatives ++++++ flit-3.8.0.tar.gz -> flit-3.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/.bumpversion.cfg new/flit-3.9.0/.bumpversion.cfg --- old/flit-3.8.0/.bumpversion.cfg 2022-11-05 14:06:27.383138400 +0100 +++ new/flit-3.9.0/.bumpversion.cfg 2023-05-14 16:47:29.186488000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.8.0 +current_version = 3.9.0 commit = True tag = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/.github/workflows/test.yml new/flit-3.9.0/.github/workflows/test.yml --- old/flit-3.8.0/.github/workflows/test.yml 2022-11-05 13:52:43.628104400 +0100 +++ new/flit-3.9.0/.github/workflows/test.yml 2023-05-14 16:43:38.918691200 +0200 @@ -19,7 +19,31 @@ strategy: matrix: platform: ["ubuntu-latest", "windows-latest"] - python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" , "3.12-dev" ] + steps: + - uses: actions/checkout@v3 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions codecov + + - name: Run tests + run: tox + + - name: Codecov upload + run: codecov + + test-py36: + runs-on: "ubuntu-20.04" + strategy: + matrix: + python-version: [ "3.6", ] steps: - uses: actions/checkout@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/.readthedocs.yml new/flit-3.9.0/.readthedocs.yml --- old/flit-3.8.0/.readthedocs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.9.0/.readthedocs.yml 2023-05-14 16:43:44.522708000 +0200 @@ -0,0 +1,13 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: doc/conf.py + +python: + install: + - requirements: doc/requirements.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/PKG-INFO new/flit-3.9.0/PKG-INFO --- old/flit-3.8.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/flit-3.9.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: flit -Version: 3.8.0 +Version: 3.9.0 Summary: A simple packaging tool for simple packages. Author-email: Thomas Kluyver <tho...@kluyver.me.uk> Requires-Python: >=3.6 @@ -9,7 +9,7 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Software Development :: Libraries :: Python Modules -Requires-Dist: flit_core >=3.8.0 +Requires-Dist: flit_core >=3.9.0 Requires-Dist: requests Requires-Dist: docutils Requires-Dist: tomli-w diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/doc/cmdline.rst new/flit-3.9.0/doc/cmdline.rst --- old/flit-3.8.0/doc/cmdline.rst 2022-11-05 14:06:10.847054700 +0100 +++ new/flit-3.9.0/doc/cmdline.rst 2023-05-14 16:43:44.525708000 +0200 @@ -54,6 +54,24 @@ Generating ``setup.py`` disabled by default. +.. option:: --use-vcs + + Use the files checked in to git or mercurial as the starting list to include + in an sdist, and then apply inclusions and exclusions :ref:`from pyproject.toml + <pyproject_toml_sdist>`. + + This is the default for now, but we're planning to switch to ``--no-use-vcs`` + as the default in a future version. + +.. option:: --no-use-vcs + + Create the sdist starting with only the files inside the installed module + or package, along with any inclusions and exclusions defined in pyproject.toml. + + With this option, sdists from ``flit build`` are equivalent to those built + by tools calling Flit as a backend, such as `build + <https://pypa-build.readthedocs.io/en/stable/>`_. + .. _publish_cmd: ``flit publish`` @@ -70,19 +88,12 @@ You should normally publish the two formats together. .. option:: --setup-py - - Generate a ``setup.py`` file in the sdist, so it can be installed by older - versions of pip. - .. option:: --no-setup-py +.. option:: --use-vcs +.. option:: --no-use-vcs - Don't generate a setup.py file in the sdist. This is the default. - An sdist built without this will only work with tools that support PEP 517, - but the wheel will still be usable by any compatible tool. - - .. versionchanged:: 3.5 - - Generating ``setup.py`` disabled by default. + These options affecting what goes in the sdist are described for + :ref:`build_cmd` above. .. option:: --repository <repository> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/doc/conf.py new/flit-3.9.0/doc/conf.py --- old/flit-3.8.0/doc/conf.py 2022-11-05 14:06:27.383138400 +0100 +++ new/flit-3.9.0/doc/conf.py 2023-05-14 16:47:29.186488000 +0200 @@ -57,7 +57,7 @@ # built documents. # # The short X.Y version. -version = '3.8.0' +version = '3.9.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.8.0/doc/history.rst new/flit-3.9.0/doc/history.rst --- old/flit-3.8.0/doc/history.rst 2022-11-05 14:06:10.847054700 +0100 +++ new/flit-3.9.0/doc/history.rst 2023-05-14 16:43:44.526708000 +0200 @@ -1,6 +1,27 @@ Release history =============== +Version 3.9 +----------- + +- New options :option:`flit build --use-vcs` and :option:`flit build --no-use-vcs` + to enable & disable including all committed files in the sdist. For now + ``--use-vcs`` is the default, but this is likely to change in a future + version, to bring ``flit build`` in line with standard build frontends like + ``python -m build`` (:ghpull:`625`). +- Sdist file names, and the name of the top-level folder in an sdist, are now + normalised, in accordance with :pep:`625` (:ghpull:`628`). +- A statically defined version number can now be parsed from files called + ``version.py``, ``_version.py`` or ``__version__.py`` inside a packge, as well + as from ``__init__.py``, so executing code is required in fewer cases + (:ghpull:`630`). +- Fix setting the flag for regular files in zip metadata (:ghpull:`639`). +- The timestamp embedded in the gzip wrapper for sdists now defaults to a fixed + date, so building an sdist twice on the same machine should produce identical + results, even without any special steps (:ghpull:`635`). Setting + :envvar:`SOURCE_DATE_EPOCH` is still recommended for properly + :doc:`reproducible builds <reproducible>`. + Version 3.8 ----------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/doc/pyproject_toml.rst new/flit-3.9.0/doc/pyproject_toml.rst --- old/flit-3.8.0/doc/pyproject_toml.rst 2022-11-05 14:06:10.848055000 +0100 +++ new/flit-3.9.0/doc/pyproject_toml.rst 2023-05-14 16:43:38.923691000 +0200 @@ -400,10 +400,13 @@ .. versionadded:: 2.0 -When you use :ref:`build_cmd` or :ref:`publish_cmd`, Flit builds an sdist -(source distribution) tarball containing the files that are checked into version -control (git or mercurial). If you want more control, or it doesn't recognise -your version control system, you can give lists of paths or glob patterns as +With no configuration, Flit can make an sdist with everything it needs +to build and install your module: the package contents (including non-Python +data files, but not ``.pyc`` bytecode files), your ``pyproject.toml`` file, +the readme & license files given in the metadata, and the :ref:`external data +folder <pyproject_toml_external_data>` if you specified that. + +If you want more control, you can give lists of paths or glob patterns as ``include`` and ``exclude`` in this section. For example: .. code-block:: toml @@ -429,13 +432,22 @@ Exclusions have priority over inclusions. Bytecode is excluded by default and cannot be included. -.. note:: +Including files committed in git/hg +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - If you are not using :ref:`build_cmd` but ``flit_core`` via another build - frontend, Flit doesn't doesn't check the VCS for files to include but instead - builds a 'minimal' sdist (which includes the files necessary to build a wheel). - You'll have to adapt your inclusion/exclusion rules to achieve the same result - as you'd get with :ref:`build_cmd`. +If you use :ref:`build_cmd` or :ref:`publish_cmd`, you can also make sdists with +the files which are committed in version control (git or hg). This is a shortcut +to e.g. include documentation source files, but not built HTML or PDF +documentation. The include and exclude patterns are then applied on top of this +list. + +For now, including files from version control is the default for :ref:`build_cmd` +and :ref:`publish_cmd`, and can be disabled with ``--no-use-vcs``. The default +will switch in a future version. + +Using ``flit_core`` as a backend to other tools such as `build +<https://pypa-build.readthedocs.io/en/latest/>`_ never gets the list of files +for the sdist from version control. .. _pyproject_toml_external_data: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit/__init__.py new/flit-3.9.0/flit/__init__.py --- old/flit-3.8.0/flit/__init__.py 2022-11-05 14:06:27.381138300 +0100 +++ new/flit-3.9.0/flit/__init__.py 2023-05-14 16:47:29.185487700 +0200 @@ -12,7 +12,7 @@ from .config import ConfigError from .log import enable_colourful_output -__version__ = '3.8.0' +__version__ = '3.9.0' log = logging.getLogger(__name__) @@ -67,7 +67,47 @@ 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 add_shared_build_options(parser: argparse.ArgumentParser): + parser.add_argument('--format', action='append', + help="Select a format to publish. Options: 'wheel', 'sdist'" + ) + + setup_py_grp = parser.add_mutually_exclusive_group() + + setup_py_grp.add_argument('--setup-py', action='store_true', + help=("Generate a setup.py file in the sdist. " + "The sdist will work with older tools that predate PEP 517. " + ) + ) + + setup_py_grp.add_argument('--no-setup-py', action='store_true', + help=("Don't generate a setup.py file in the sdist. This is the default. " + "The sdist will only work with tools that support PEP 517, " + "but the wheel will still be usable by any compatible tool." + ) + ) + + vcs_grp = parser.add_mutually_exclusive_group() + + vcs_grp.add_argument('--use-vcs', action='store_true', + help=("Choose which files to include in the sdist using git or hg. " + "This is a convenient way to include all checked-in files, like " + "tests and doc source files, in your sdist, but requires that git " + "or hg is available on the command line. This is currently the " + "default, but it will change in a future version. " + ) + ) + + vcs_grp.add_argument('--no-use-vcs', action='store_true', + help=("Select the files to include in the sdist without using git or hg. " + "This should include all essential files to install and use your " + "package; see the documentation for precisely what is included. " + "This will become the default in a future version." + ) + ) + def main(argv=None): ap = argparse.ArgumentParser() @@ -85,45 +125,14 @@ help="Build wheel and sdist", ) - parser_build.add_argument('--format', action='append', - help="Select a format to build. Options: 'wheel', 'sdist'" - ) - - parser_build.add_argument('--setup-py', action='store_true', - help=("Generate a setup.py file in the sdist. " - "The sdist will work with older tools that predate PEP 517. " - ) - ) - - parser_build.add_argument('--no-setup-py', action='store_true', - help=("Don't generate a setup.py file in the sdist. This is the default. " - "The sdist will only work with tools that support PEP 517, " - "but the wheel will still be usable by any compatible tool." - ) - ) + add_shared_build_options(parser_build) # flit publish -------------------------------------------- parser_publish = subparsers.add_parser('publish', help="Upload wheel and sdist", ) - parser_publish.add_argument('--format', action='append', - help="Select a format to publish. Options: 'wheel', 'sdist'" - ) - - parser_publish.add_argument('--setup-py', action='store_true', - help=("Generate a setup.py file in the sdist. " - "The sdist will work with older tools that predate PEP 517. " - "This is the default for now, but will change in a future version." - ) - ) - - parser_publish.add_argument('--no-setup-py', action='store_true', - help=("Don't generate a setup.py file in the sdist. " - "The sdist will only work with tools that support PEP 517, " - "but the wheel will still be usable by any compatible tool." - ) - ) + add_shared_build_options(parser_publish) parser_publish.add_argument('--pypirc', help="The .pypirc config file to be used. DEFAULT = \"~/.pypirc\"" @@ -173,11 +182,14 @@ return False return args.setup_py + def sdist_use_vcs(): + return not args.no_use_vcs + if args.subcmd == 'build': from .build import main try: main(args.ini_file, formats=set(args.format or []), - gen_setup_py=gen_setup_py()) + gen_setup_py=gen_setup_py(), use_vcs=sdist_use_vcs()) except(common.NoDocstringError, common.VCSError, common.NoVersionError) as e: sys.exit(e.args[0]) elif args.subcmd == 'publish': @@ -186,7 +198,7 @@ repository = args.repository or args.deprecated_repository from .upload import main main(args.ini_file, repository, args.pypirc, formats=set(args.format or []), - gen_setup_py=gen_setup_py()) + gen_setup_py=gen_setup_py(), use_vcs=sdist_use_vcs()) elif args.subcmd == 'install': from .install import Installer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit/build.py new/flit-3.9.0/flit/build.py --- old/flit-3.8.0/flit/build.py 2021-11-14 15:34:30.344272600 +0100 +++ new/flit-3.9.0/flit/build.py 2023-05-14 16:43:38.924691200 +0200 @@ -26,7 +26,7 @@ assert len(files) == 1, files yield os.path.join(tmpdir, files[0]) -def main(ini_file: Path, formats=None, gen_setup_py=True): +def main(ini_file: Path, formats=None, gen_setup_py=True, use_vcs=True): """Build wheel and sdist""" if not formats: formats = ALL_FORMATS @@ -42,7 +42,7 @@ read_flit_config(ini_file) if 'sdist' in formats: - sb = SdistBuilder.from_ini_path(ini_file) + sb = SdistBuilder.from_ini_path(ini_file, use_vcs=use_vcs) sdist_file = sb.build(dist_dir, gen_setup_py=gen_setup_py) sdist_info = SimpleNamespace(builder=sb, file=sdist_file) # When we're building both, build the wheel from the unpacked sdist. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit/sdist.py new/flit-3.9.0/flit/sdist.py --- old/flit-3.8.0/flit/sdist.py 2021-11-18 23:10:43.575393000 +0100 +++ new/flit-3.9.0/flit/sdist.py 2023-05-14 16:43:38.925691100 +0200 @@ -156,7 +156,18 @@ - Add a generated setup.py for compatibility with tools which don't yet know about PEP 517. """ + use_vcs = True + + @classmethod + def from_ini_path(cls, ini_path: Path, use_vcs=True): + inst = super().from_ini_path(ini_path) + inst.use_vcs = use_vcs + return inst + def select_files(self): + if not self.use_vcs: + return super().select_files() + vcs_mod = identify_vcs(self.cfgdir) if vcs_mod is not None: untracked_deleted = vcs_mod.list_untracked_deleted_files(self.cfgdir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit/upload.py new/flit-3.9.0/flit/upload.py --- old/flit-3.8.0/flit/upload.py 2022-11-05 13:52:43.629104400 +0100 +++ new/flit-3.9.0/flit/upload.py 2023-05-14 16:43:38.926691000 +0200 @@ -260,7 +260,8 @@ log.info("Package is at %s/%s", repo['url'], metadata.name) -def main(ini_path, repo_name, pypirc_path=None, formats=None, gen_setup_py=True): +def main(ini_path, repo_name, pypirc_path=None, formats=None, gen_setup_py=True, + use_vcs=True): """Build and upload wheel and sdist.""" if pypirc_path is None: pypirc_path = PYPIRC_DEFAULT @@ -268,7 +269,9 @@ raise FileNotFoundError("The specified pypirc config file does not exist.") from . import build - built = build.main(ini_path, formats=formats, gen_setup_py=gen_setup_py) + built = build.main( + ini_path, formats=formats, gen_setup_py=gen_setup_py, use_vcs=use_vcs + ) if built.wheel is not None: do_upload(built.wheel.file, built.wheel.builder.metadata, pypirc_path, repo_name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/README.rst new/flit-3.9.0/flit_core/README.rst --- old/flit-3.8.0/flit_core/README.rst 2021-11-14 15:34:30.346272500 +0100 +++ new/flit-3.9.0/flit_core/README.rst 2023-05-14 16:43:38.926691000 +0200 @@ -1,6 +1,9 @@ flit_core --------- -This provides a PEP 517 build backend for packages using Flit. -The only public interface is the API specified by PEP 517, at ``flit_core.buildapi``. +This provides a `PEP 517 <https://peps.python.org/pep-0517/>`_ build backend +for packages using `Flit <https://pypi.org/project/flit/>`_. The only public +interface is the API specified by PEP 517, at ``flit_core.buildapi``. +See the `Flit documentation <https://flit.pypa.io/en/stable/>`_ for more +information. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/__init__.py new/flit-3.9.0/flit_core/flit_core/__init__.py --- old/flit-3.8.0/flit_core/flit_core/__init__.py 2022-11-05 14:06:27.382138300 +0100 +++ new/flit-3.9.0/flit_core/flit_core/__init__.py 2023-05-14 16:47:29.185487700 +0200 @@ -4,4 +4,4 @@ All the convenient development features live in the main 'flit' package. """ -__version__ = '3.8.0' +__version__ = '3.9.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/common.py new/flit-3.9.0/flit_core/flit_core/common.py --- old/flit-3.8.0/flit_core/flit_core/common.py 2022-11-05 13:52:43.629104400 +0100 +++ new/flit-3.9.0/flit_core/flit_core/common.py 2023-05-14 16:43:38.927691200 +0200 @@ -71,6 +71,21 @@ else: return self.path + @property + def version_files(self): + """Files which will be parsed to find a version number + + Files later in this list take precedence over earlier ones. + """ + if self.is_package: + paths = [self.path / '__init__.py'] + for filename in ('version.py', '_version.py', '__version__.py'): + if (self.path / filename).is_file(): + paths.insert(0, self.path / filename) + return paths + else: + return [self.path] + def iter_files(self): """Iterate over the files contained in this module. @@ -127,26 +142,26 @@ Return a tuple like (docstring, version) for the given module, extracted by parsing its AST. """ - # read as bytes to enable custom encodings - with target.file.open('rb') as f: - node = ast.parse(f.read()) - for child in node.body: - # Only use the version from the given module if it's a simple - # string assignment to __version__ - is_version_str = ( - isinstance(child, ast.Assign) - 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: - version = child.value.s - break - else: - version = None + version = None + for target_path in target.version_files: + # read as bytes to enable custom encodings + with target_path.open('rb') as f: + node = ast.parse(f.read()) + for child in node.body: + # Only use the version from the given module if it's a simple + # string assignment to __version__ + is_version_str = ( + isinstance(child, ast.Assign) + 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: + version = child.value.s + break return ast.get_docstring(node), version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/sdist.py new/flit-3.9.0/flit_core/flit_core/sdist.py --- old/flit-3.8.0/flit_core/flit_core/sdist.py 2022-11-05 13:52:43.630104300 +0100 +++ new/flit-3.9.0/flit_core/flit_core/sdist.py 2023-05-14 16:43:38.928691100 +0200 @@ -157,16 +157,17 @@ @property def dir_name(self): - return '{}-{}'.format(self.metadata.name, self.metadata.version) + return common.normalize_dist_name(self.metadata.name, self.metadata.version) def build(self, target_dir, gen_setup_py=True): os.makedirs(str(target_dir), exist_ok=True) - target = target_dir / '{}-{}.tar.gz'.format( - self.metadata.name, self.metadata.version - ) + target = target_dir / '{}.tar.gz'.format(self.dir_name) source_date_epoch = os.environ.get('SOURCE_DATE_EPOCH', '') mtime = int(source_date_epoch) if source_date_epoch else None - gz = GzipFile(str(target), mode='wb', mtime=mtime) + # For the gzip timestamp, default to 2016-1-1 00:00 (UTC) + # This makes the sdist reproducible even without SOURCE_DATE_EPOCH, + # if the source file mtimes don't change, i.e. from the same checkout. + gz = GzipFile(str(target), mode='wb', mtime=(mtime or 1451606400)) tf = tarfile.TarFile(str(target), mode='w', fileobj=gz, format=tarfile.PAX_FORMAT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/tests/samples/imported_version/package1/__init__.py new/flit-3.9.0/flit_core/flit_core/tests/samples/imported_version/package1/__init__.py --- old/flit-3.8.0/flit_core/flit_core/tests/samples/imported_version/package1/__init__.py 2022-11-05 13:52:43.630104300 +0100 +++ new/flit-3.9.0/flit_core/flit_core/tests/samples/imported_version/package1/__init__.py 2023-05-14 16:43:38.928691100 +0200 @@ -1,3 +1,5 @@ """This module has a __version__ that requires a relative import""" from ._version import __version__ + +import a_package_that_doesnt_exist \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/tests/samples/imported_version/package1/_version.py new/flit-3.9.0/flit_core/flit_core/tests/samples/imported_version/package1/_version.py --- old/flit-3.8.0/flit_core/flit_core/tests/samples/imported_version/package1/_version.py 2022-11-05 13:52:43.630104300 +0100 +++ new/flit-3.9.0/flit_core/flit_core/tests/samples/imported_version/package1/_version.py 2023-05-14 16:43:38.928691100 +0200 @@ -1 +1,3 @@ +"""Imposter docstring that shouldn't be used""" + __version__ = '0.5.8' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml new/flit-3.9.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml --- old/flit-3.8.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml 2022-11-05 13:52:43.630104300 +0100 +++ new/flit-3.9.0/flit_core/flit_core/tests/samples/normalization/pyproject.toml 2023-05-14 16:43:38.928691100 +0200 @@ -5,7 +5,7 @@ [project] name = "my-python-module" version = "0.0.1" -description = "Hyphenated package name, infered import name" +description = "Hyphenated package name, inferred import name" authors = [ {name = "Sir Robin", email = "ro...@camelot.uk"} ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/tests/test_sdist.py new/flit-3.9.0/flit_core/flit_core/tests/test_sdist.py --- old/flit-3.8.0/flit_core/flit_core/tests/test_sdist.py 2022-11-05 13:52:43.631104500 +0100 +++ new/flit-3.9.0/flit_core/flit_core/tests/test_sdist.py 2023-05-14 16:43:38.929691000 +0200 @@ -59,3 +59,12 @@ files = builder.apply_includes_excludes(builder.select_files()) assert osp.join('data', 'share', 'man', 'man1', 'foo.1') in files + + +def test_pep625(tmp_path): + builder = sdist.SdistBuilder.from_ini_path( + samples_dir / 'normalization' / 'pyproject.toml' + ) + path = builder.build(tmp_path) + assert path == tmp_path / 'my_python_module-0.0.1.tar.gz' + assert_isfile(path) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/flit_core/wheel.py new/flit-3.9.0/flit_core/flit_core/wheel.py --- old/flit-3.8.0/flit_core/flit_core/wheel.py 2022-11-05 13:52:43.631104500 +0100 +++ new/flit-3.9.0/flit_core/flit_core/wheel.py 2023-05-14 16:43:38.930691200 +0200 @@ -33,7 +33,7 @@ def _set_zinfo_mode(zinfo, mode): - # Set the bits for the mode and bit 0xFFFF for âregular fileâ + # Set the bits for the mode zinfo.external_attr = mode << 16 @@ -147,7 +147,8 @@ # give you the exact same result. date_time = self.source_time_stamp or (2016, 1, 1, 0, 0, 0) zi = zipfile.ZipInfo(rel_path, date_time) - _set_zinfo_mode(zi, mode) + # Also sets bit 0x8000 for "regular file" (S_IFREG) + _set_zinfo_mode(zi, mode | stat.S_IFREG) b = sio.getvalue().encode('utf-8') hashsum = hashlib.sha256(b) hash_digest = urlsafe_b64encode(hashsum.digest()).decode('ascii').rstrip('=') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/flit_core/pyproject.toml new/flit-3.9.0/flit_core/pyproject.toml --- old/flit-3.8.0/flit_core/pyproject.toml 2022-11-05 13:52:43.631104500 +0100 +++ new/flit-3.9.0/flit_core/pyproject.toml 2023-05-14 16:43:38.931691200 +0200 @@ -11,6 +11,7 @@ description = "Distribution-building parts of Flit. See flit package for more information" dependencies = [] requires-python = '>=3.6' +readme = "README.rst" license = {file = "LICENSE"} classifiers = [ "License :: OSI Approved :: BSD License", @@ -19,6 +20,7 @@ dynamic = ["version"] [project.urls] +Documentation = "https://flit.pypa.io" Source = "https://github.com/pypa/flit" [tool.flit.sdist] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/pyproject.toml new/flit-3.9.0/pyproject.toml --- old/flit-3.8.0/pyproject.toml 2022-11-05 14:06:27.381138300 +0100 +++ new/flit-3.9.0/pyproject.toml 2023-05-14 16:47:29.184487800 +0200 @@ -1,5 +1,5 @@ [build-system] -requires = ["flit_core >=3.8.0,<4"] +requires = ["flit_core >=3.9.0,<4"] build-backend = "flit_core.buildapi" [project] @@ -8,7 +8,7 @@ {name = "Thomas Kluyver", email = "tho...@kluyver.me.uk"}, ] dependencies = [ - "flit_core >=3.8.0", + "flit_core >=3.9.0", "requests", "docutils", "tomli-w", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/tests/test_wheel.py new/flit-3.9.0/tests/test_wheel.py --- old/flit-3.8.0/tests/test_wheel.py 2021-11-18 23:10:43.579393100 +0100 +++ new/flit-3.9.0/tests/test_wheel.py 2023-05-14 16:43:38.932691000 +0200 @@ -1,5 +1,6 @@ import configparser import os +import stat from pathlib import Path import tempfile from unittest import skipIf @@ -199,6 +200,10 @@ perms = (info.external_attr >> 16) & 0o777 assert perms == 0o644, oct(perms) + info = zf.getinfo('module1-0.1.dist-info/RECORD') + perms = (info.external_attr >> 16) & stat.S_IFREG + assert perms + def test_compression(tmp_path): info = make_wheel_in(samples_dir / 'module1_toml' / 'pyproject.toml', tmp_path) assert_isfile(info.file) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flit-3.8.0/tox.ini new/flit-3.9.0/tox.ini --- old/flit-3.8.0/tox.ini 2022-11-05 13:52:43.632104400 +0100 +++ new/flit-3.9.0/tox.ini 2023-05-14 16:43:38.932691000 +0200 @@ -34,7 +34,7 @@ skip_install = true # Make the install step a no-op, so nothing gets installed in the env install_command = true {packages} -whitelist_externals = true +allowlist_externals = true changedir = flit_core commands = python -c "from flit_core.buildapi import build_wheel;\