We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
update pypi metadata
master (1.2): alpha -> beta (and keep that at least until 1.2.1)

1.1-maint: definitely beta -> stable

https://pypi.org/classifiers/


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # borgbackup - main setup code (see also other setup_*.py files)
2 
3 import os
4 import sys
5 from collections import defaultdict
6 from glob import glob
7 
8 try:
9     import multiprocessing
10 except ImportError:
11     multiprocessing = None
12 
13 from setuptools.command.build_ext import build_ext
14 from setuptools import setup, find_packages, Extension, Command
15 from setuptools.command.sdist import sdist
16 
17 try:
18     from Cython.Build import cythonize
19 except ImportError:
20     cythonize = None
21 
22 import setup_checksums
23 import setup_compress
24 import setup_crypto
25 import setup_docs
26 
27 is_win32 = sys.platform.startswith('win32')
28 
29 # How the build process finds the system libs / uses the bundled code:
30 #
31 # 1. it will try to use (system) libs (see 1.1. and 1.2.),
32 #    except if you use these env vars to force using the bundled code:
33 #    BORG_USE_BUNDLED_XXX undefined  -->  try using system lib
34 #    BORG_USE_BUNDLED_XXX=YES        -->  use the bundled code
35 #    Note: do not use =NO, that is not supported!
36 # 1.1. if BORG_LIBXXX_PREFIX is set, it will use headers and libs from there.
37 # 1.2. if not and pkg-config can locate the lib, the lib located by
38 #      pkg-config will be used. We use the pkg-config tool via the pkgconfig
39 #      python package, which must be installed before invoking setup.py.
40 #      if pkgconfig is not installed, this step is skipped.
41 # 2. if no system lib could be located via 1.1. or 1.2., it will fall back
42 #    to using the bundled code.
43 
44 # OpenSSL is required as a (system) lib in any case as we do not bundle it.
45 # Thus, only step 1.1. and 1.2. apply to openssl (but not 1. and 2.).
46 # needed: openssl >=1.0.2 or >=1.1.0 (or compatible)
47 system_prefix_openssl = os.environ.get('BORG_OPENSSL_PREFIX')
48 
49 # needed: lz4 (>= 1.7.0 / r129)
50 prefer_system_liblz4 = not bool(os.environ.get('BORG_USE_BUNDLED_LZ4'))
51 system_prefix_liblz4 = os.environ.get('BORG_LIBLZ4_PREFIX')
52 
53 # needed: zstd (>= 1.3.0)
54 prefer_system_libzstd = not bool(os.environ.get('BORG_USE_BUNDLED_ZSTD'))
55 system_prefix_libzstd = os.environ.get('BORG_LIBZSTD_PREFIX')
56 
57 prefer_system_libxxhash = not bool(os.environ.get('BORG_USE_BUNDLED_XXHASH'))
58 system_prefix_libxxhash = os.environ.get('BORG_LIBXXHASH_PREFIX')
59 
60 # Number of threads to use for cythonize, not used on windows
61 cpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing.get_start_method() != 'spawn' else None
62 
63 # Are we building on ReadTheDocs?
64 on_rtd = os.environ.get('READTHEDOCS')
65 
66 install_requires = [
67     # we are rather picky about msgpack versions, because a good working msgpack is
68     # very important for borg, see: https://github.com/borgbackup/borg/issues/3753
69     'msgpack >=0.5.6, <=1.0.3, !=1.0.1',
70     # Please note:
71     # using any other version is not supported by borg development and
72     # any feedback related to issues caused by this will be ignored.
73     'packaging',
74 ]
75 
76 # note for package maintainers: if you package borgbackup for distribution,
77 # please (if available) add pyfuse3 (preferably) or llfuse (not maintained any more)
78 # as a *requirement*. "borg mount" needs one of them to work.
79 # if neither is available, do not require it, most of borgbackup will work.
80 extras_require = {
81     'llfuse': [
82         'llfuse >= 1.3.8',
83     ],
84     'pyfuse3': [
85         'pyfuse3 >= 3.1.1',
86     ],
87     'nofuse': [],
88 }
89 
90 compress_source = 'src/borg/compress.pyx'
91 crypto_ll_source = 'src/borg/crypto/low_level.pyx'
92 crypto_helpers = 'src/borg/crypto/_crypto_helpers.c'
93 chunker_source = 'src/borg/chunker.pyx'
94 hashindex_source = 'src/borg/hashindex.pyx'
95 item_source = 'src/borg/item.pyx'
96 checksums_source = 'src/borg/algorithms/checksums.pyx'
97 platform_posix_source = 'src/borg/platform/posix.pyx'
98 platform_linux_source = 'src/borg/platform/linux.pyx'
99 platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'
100 platform_darwin_source = 'src/borg/platform/darwin.pyx'
101 platform_freebsd_source = 'src/borg/platform/freebsd.pyx'
102 platform_windows_source = 'src/borg/platform/windows.pyx'
103 
104 cython_sources = [
105     compress_source,
106     crypto_ll_source,
107     chunker_source,
108     hashindex_source,
109     item_source,
110     checksums_source,
111 
112     platform_posix_source,
113     platform_linux_source,
114     platform_syncfilerange_source,
115     platform_freebsd_source,
116     platform_darwin_source,
117     platform_windows_source,
118 ]
119 
120 if cythonize:
121     Sdist = sdist
122 else:
123     class Sdist(sdist):
124         def __init__(self, *args, **kwargs):
125             raise Exception('Cython is required to run sdist')
126 
127     cython_c_files = [fn.replace('.pyx', '.c') for fn in cython_sources]
128     if not on_rtd and not all(os.path.exists(path) for path in cython_c_files):
129         raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')
130 
131 
132 def rm(file):
133     try:
134         os.unlink(file)
135         print('rm', file)
136     except FileNotFoundError:
137         pass
138 
139 
140 class Clean(Command):
141     user_options = []
142 
143     def initialize_options(self):
144         pass
145 
146     def finalize_options(self):
147         pass
148 
149     def run(self):
150         for source in cython_sources:
151             genc = source.replace('.pyx', '.c')
152             rm(genc)
153             compiled_glob = source.replace('.pyx', '.cpython*')
154             for compiled in sorted(glob(compiled_glob)):
155                 rm(compiled)
156 
157 
158 cmdclass = {
159     'build_ext': build_ext,
160     'build_usage': setup_docs.build_usage,
161     'build_man': setup_docs.build_man,
162     'sdist': Sdist,
163     'clean2': Clean,
164 }
165 
166 ext_modules = []
167 if not on_rtd:
168 
169     def members_appended(*ds):
170         result = defaultdict(list)
171         for d in ds:
172             for k, v in d.items():
173                 assert isinstance(v, list)
174                 result[k].extend(v)
175         return result
176 
177     try:
178         import pkgconfig as pc
179     except ImportError:
180         print('Warning: can not import pkgconfig python package.')
181         pc = None
182 
183     crypto_ext_kwargs = members_appended(
184         dict(sources=[crypto_ll_source, crypto_helpers]),
185         setup_crypto.crypto_ext_kwargs(pc, system_prefix_openssl),
186     )
187 
188     compress_ext_kwargs = members_appended(
189         dict(sources=[compress_source]),
190         setup_compress.lz4_ext_kwargs(pc, prefer_system_liblz4, system_prefix_liblz4),
191         setup_compress.zstd_ext_kwargs(pc, prefer_system_libzstd, system_prefix_libzstd,
192                                        multithreaded=False, legacy=False),
193     )
194 
195     checksums_ext_kwargs = members_appended(
196         dict(sources=[checksums_source]),
197         setup_checksums.xxhash_ext_kwargs(pc, prefer_system_libxxhash, system_prefix_libxxhash),
198     )
199 
200     ext_modules += [
201         Extension('borg.crypto.low_level', **crypto_ext_kwargs),
202         Extension('borg.compress', **compress_ext_kwargs),
203         Extension('borg.hashindex', [hashindex_source]),
204         Extension('borg.item', [item_source]),
205         Extension('borg.chunker', [chunker_source]),
206         Extension('borg.algorithms.checksums', **checksums_ext_kwargs),
207     ]
208 
209     posix_ext = Extension('borg.platform.posix', [platform_posix_source])
210     linux_ext = Extension('borg.platform.linux', [platform_linux_source], libraries=['acl'])
211     syncfilerange_ext = Extension('borg.platform.syncfilerange', [platform_syncfilerange_source])
212     freebsd_ext = Extension('borg.platform.freebsd', [platform_freebsd_source])
213     darwin_ext = Extension('borg.platform.darwin', [platform_darwin_source])
214     windows_ext = Extension('borg.platform.windows', [platform_windows_source])
215 
216     if not is_win32:
217         ext_modules.append(posix_ext)
218     else:
219         ext_modules.append(windows_ext)
220     if sys.platform == 'linux':
221         ext_modules.append(linux_ext)
222         ext_modules.append(syncfilerange_ext)
223     elif sys.platform.startswith('freebsd'):
224         ext_modules.append(freebsd_ext)
225     elif sys.platform == 'darwin':
226         ext_modules.append(darwin_ext)
227 
228     # sometimes there's no need to cythonize
229     # this breaks chained commands like 'clean sdist'
230     cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (
231         ('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]
232 
233     if cythonize and cythonizing:
234         cython_opts = dict(
235             # default language_level will be '3str' starting from Cython 3.0.0,
236             # but old cython versions (< 0.29) do not know that, thus we use 3 for now.
237             compiler_directives={'language_level': 3},
238         )
239         if not is_win32:
240             # compile .pyx extensions to .c in parallel, does not work on windows
241             cython_opts['nthreads'] = cpu_threads
242 
243         # generate C code from Cython for ALL supported platforms, so we have them in the sdist.
244         # the sdist does not require Cython at install time, so we need all as C.
245         cythonize([posix_ext, linux_ext, syncfilerange_ext, freebsd_ext, darwin_ext, windows_ext], **cython_opts)
246         # generate C code from Cython for THIS platform (and for all platform-independent Cython parts).
247         ext_modules = cythonize(ext_modules, **cython_opts)
248 
249 
250 setup(
251     name='borgbackup',
252     use_scm_version={
253         'write_to': 'src/borg/_version.py',
254     },
255     author='The Borg Collective (see AUTHORS file)',
256     author_email='borgbackup@python.org',
257     url='https://borgbackup.readthedocs.io/',
258     description='Deduplicated, encrypted, authenticated and compressed backups',
259     long_description=setup_docs.long_desc_from_readme(),
260     license='BSD',
261     platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],
262     classifiers=[
263         'Development Status :: 3 - Alpha',
264         'Environment :: Console',
265         'Intended Audience :: System Administrators',
266         'License :: OSI Approved :: BSD License',
267         'Operating System :: POSIX :: BSD :: FreeBSD',
268         'Operating System :: POSIX :: BSD :: OpenBSD',
269         'Operating System :: POSIX :: BSD :: NetBSD',
270         'Operating System :: MacOS :: MacOS X',
271         'Operating System :: POSIX :: Linux',
272         'Programming Language :: Python',
273         'Programming Language :: Python :: 3',
274         'Programming Language :: Python :: 3.8',
275         'Programming Language :: Python :: 3.9',
276         'Programming Language :: Python :: 3.10',
277         'Topic :: Security :: Cryptography',
278         'Topic :: System :: Archiving :: Backup',
279     ],
280     packages=find_packages('src'),
281     package_dir={'': 'src'},
282     zip_safe=False,
283     entry_points={
284         'console_scripts': [
285             'borg = borg.archiver:main',
286             'borgfs = borg.archiver:main',
287         ]
288     },
289     # See also the MANIFEST.in file.
290     # We want to install all the files in the package directories...
291     include_package_data=True,
292     # ...except the source files which have been compiled (C extensions):
293     exclude_package_data={
294         '': ['*.c', '*.h', '*.pyx', ],
295     },
296     cmdclass=cmdclass,
297     ext_modules=ext_modules,
298     setup_requires=['setuptools_scm>=1.7'],
299     install_requires=install_requires,
300     extras_require=extras_require,
301     python_requires='>=3.8',
302 )
303
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -260,7 +260,7 @@
     license='BSD',
     platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],
     classifiers=[
-        'Development Status :: 3 - Alpha',
+        'Development Status :: 4 - Beta',
         'Environment :: Console',
         'Intended Audience :: System Administrators',
         'License :: OSI Approved :: BSD License',

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -260,7 +260,7 @@\n     license='BSD',\n     platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],\n     classifiers=[\n-        'Development Status :: 3 - Alpha',\n+        'Development Status :: 4 - Beta',\n         'Environment :: Console',\n         'Intended Audience :: System Administrators',\n         'License :: OSI Approved :: BSD License',\n", "issue": "update pypi metadata\nmaster (1.2): alpha -> beta (and keep that at least until 1.2.1)\r\n\r\n1.1-maint: definitely beta -> stable\r\n\r\nhttps://pypi.org/classifiers/\r\n\n", "before_files": [{"content": "# borgbackup - main setup code (see also other setup_*.py files)\n\nimport os\nimport sys\nfrom collections import defaultdict\nfrom glob import glob\n\ntry:\n    import multiprocessing\nexcept ImportError:\n    multiprocessing = None\n\nfrom setuptools.command.build_ext import build_ext\nfrom setuptools import setup, find_packages, Extension, Command\nfrom setuptools.command.sdist import sdist\n\ntry:\n    from Cython.Build import cythonize\nexcept ImportError:\n    cythonize = None\n\nimport setup_checksums\nimport setup_compress\nimport setup_crypto\nimport setup_docs\n\nis_win32 = sys.platform.startswith('win32')\n\n# How the build process finds the system libs / uses the bundled code:\n#\n# 1. it will try to use (system) libs (see 1.1. and 1.2.),\n#    except if you use these env vars to force using the bundled code:\n#    BORG_USE_BUNDLED_XXX undefined  -->  try using system lib\n#    BORG_USE_BUNDLED_XXX=YES        -->  use the bundled code\n#    Note: do not use =NO, that is not supported!\n# 1.1. if BORG_LIBXXX_PREFIX is set, it will use headers and libs from there.\n# 1.2. if not and pkg-config can locate the lib, the lib located by\n#      pkg-config will be used. We use the pkg-config tool via the pkgconfig\n#      python package, which must be installed before invoking setup.py.\n#      if pkgconfig is not installed, this step is skipped.\n# 2. if no system lib could be located via 1.1. or 1.2., it will fall back\n#    to using the bundled code.\n\n# OpenSSL is required as a (system) lib in any case as we do not bundle it.\n# Thus, only step 1.1. and 1.2. apply to openssl (but not 1. and 2.).\n# needed: openssl >=1.0.2 or >=1.1.0 (or compatible)\nsystem_prefix_openssl = os.environ.get('BORG_OPENSSL_PREFIX')\n\n# needed: lz4 (>= 1.7.0 / r129)\nprefer_system_liblz4 = not bool(os.environ.get('BORG_USE_BUNDLED_LZ4'))\nsystem_prefix_liblz4 = os.environ.get('BORG_LIBLZ4_PREFIX')\n\n# needed: zstd (>= 1.3.0)\nprefer_system_libzstd = not bool(os.environ.get('BORG_USE_BUNDLED_ZSTD'))\nsystem_prefix_libzstd = os.environ.get('BORG_LIBZSTD_PREFIX')\n\nprefer_system_libxxhash = not bool(os.environ.get('BORG_USE_BUNDLED_XXHASH'))\nsystem_prefix_libxxhash = os.environ.get('BORG_LIBXXHASH_PREFIX')\n\n# Number of threads to use for cythonize, not used on windows\ncpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing.get_start_method() != 'spawn' else None\n\n# Are we building on ReadTheDocs?\non_rtd = os.environ.get('READTHEDOCS')\n\ninstall_requires = [\n    # we are rather picky about msgpack versions, because a good working msgpack is\n    # very important for borg, see: https://github.com/borgbackup/borg/issues/3753\n    'msgpack >=0.5.6, <=1.0.3, !=1.0.1',\n    # Please note:\n    # using any other version is not supported by borg development and\n    # any feedback related to issues caused by this will be ignored.\n    'packaging',\n]\n\n# note for package maintainers: if you package borgbackup for distribution,\n# please (if available) add pyfuse3 (preferably) or llfuse (not maintained any more)\n# as a *requirement*. \"borg mount\" needs one of them to work.\n# if neither is available, do not require it, most of borgbackup will work.\nextras_require = {\n    'llfuse': [\n        'llfuse >= 1.3.8',\n    ],\n    'pyfuse3': [\n        'pyfuse3 >= 3.1.1',\n    ],\n    'nofuse': [],\n}\n\ncompress_source = 'src/borg/compress.pyx'\ncrypto_ll_source = 'src/borg/crypto/low_level.pyx'\ncrypto_helpers = 'src/borg/crypto/_crypto_helpers.c'\nchunker_source = 'src/borg/chunker.pyx'\nhashindex_source = 'src/borg/hashindex.pyx'\nitem_source = 'src/borg/item.pyx'\nchecksums_source = 'src/borg/algorithms/checksums.pyx'\nplatform_posix_source = 'src/borg/platform/posix.pyx'\nplatform_linux_source = 'src/borg/platform/linux.pyx'\nplatform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'\nplatform_darwin_source = 'src/borg/platform/darwin.pyx'\nplatform_freebsd_source = 'src/borg/platform/freebsd.pyx'\nplatform_windows_source = 'src/borg/platform/windows.pyx'\n\ncython_sources = [\n    compress_source,\n    crypto_ll_source,\n    chunker_source,\n    hashindex_source,\n    item_source,\n    checksums_source,\n\n    platform_posix_source,\n    platform_linux_source,\n    platform_syncfilerange_source,\n    platform_freebsd_source,\n    platform_darwin_source,\n    platform_windows_source,\n]\n\nif cythonize:\n    Sdist = sdist\nelse:\n    class Sdist(sdist):\n        def __init__(self, *args, **kwargs):\n            raise Exception('Cython is required to run sdist')\n\n    cython_c_files = [fn.replace('.pyx', '.c') for fn in cython_sources]\n    if not on_rtd and not all(os.path.exists(path) for path in cython_c_files):\n        raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')\n\n\ndef rm(file):\n    try:\n        os.unlink(file)\n        print('rm', file)\n    except FileNotFoundError:\n        pass\n\n\nclass Clean(Command):\n    user_options = []\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def run(self):\n        for source in cython_sources:\n            genc = source.replace('.pyx', '.c')\n            rm(genc)\n            compiled_glob = source.replace('.pyx', '.cpython*')\n            for compiled in sorted(glob(compiled_glob)):\n                rm(compiled)\n\n\ncmdclass = {\n    'build_ext': build_ext,\n    'build_usage': setup_docs.build_usage,\n    'build_man': setup_docs.build_man,\n    'sdist': Sdist,\n    'clean2': Clean,\n}\n\next_modules = []\nif not on_rtd:\n\n    def members_appended(*ds):\n        result = defaultdict(list)\n        for d in ds:\n            for k, v in d.items():\n                assert isinstance(v, list)\n                result[k].extend(v)\n        return result\n\n    try:\n        import pkgconfig as pc\n    except ImportError:\n        print('Warning: can not import pkgconfig python package.')\n        pc = None\n\n    crypto_ext_kwargs = members_appended(\n        dict(sources=[crypto_ll_source, crypto_helpers]),\n        setup_crypto.crypto_ext_kwargs(pc, system_prefix_openssl),\n    )\n\n    compress_ext_kwargs = members_appended(\n        dict(sources=[compress_source]),\n        setup_compress.lz4_ext_kwargs(pc, prefer_system_liblz4, system_prefix_liblz4),\n        setup_compress.zstd_ext_kwargs(pc, prefer_system_libzstd, system_prefix_libzstd,\n                                       multithreaded=False, legacy=False),\n    )\n\n    checksums_ext_kwargs = members_appended(\n        dict(sources=[checksums_source]),\n        setup_checksums.xxhash_ext_kwargs(pc, prefer_system_libxxhash, system_prefix_libxxhash),\n    )\n\n    ext_modules += [\n        Extension('borg.crypto.low_level', **crypto_ext_kwargs),\n        Extension('borg.compress', **compress_ext_kwargs),\n        Extension('borg.hashindex', [hashindex_source]),\n        Extension('borg.item', [item_source]),\n        Extension('borg.chunker', [chunker_source]),\n        Extension('borg.algorithms.checksums', **checksums_ext_kwargs),\n    ]\n\n    posix_ext = Extension('borg.platform.posix', [platform_posix_source])\n    linux_ext = Extension('borg.platform.linux', [platform_linux_source], libraries=['acl'])\n    syncfilerange_ext = Extension('borg.platform.syncfilerange', [platform_syncfilerange_source])\n    freebsd_ext = Extension('borg.platform.freebsd', [platform_freebsd_source])\n    darwin_ext = Extension('borg.platform.darwin', [platform_darwin_source])\n    windows_ext = Extension('borg.platform.windows', [platform_windows_source])\n\n    if not is_win32:\n        ext_modules.append(posix_ext)\n    else:\n        ext_modules.append(windows_ext)\n    if sys.platform == 'linux':\n        ext_modules.append(linux_ext)\n        ext_modules.append(syncfilerange_ext)\n    elif sys.platform.startswith('freebsd'):\n        ext_modules.append(freebsd_ext)\n    elif sys.platform == 'darwin':\n        ext_modules.append(darwin_ext)\n\n    # sometimes there's no need to cythonize\n    # this breaks chained commands like 'clean sdist'\n    cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (\n        ('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]\n\n    if cythonize and cythonizing:\n        cython_opts = dict(\n            # default language_level will be '3str' starting from Cython 3.0.0,\n            # but old cython versions (< 0.29) do not know that, thus we use 3 for now.\n            compiler_directives={'language_level': 3},\n        )\n        if not is_win32:\n            # compile .pyx extensions to .c in parallel, does not work on windows\n            cython_opts['nthreads'] = cpu_threads\n\n        # generate C code from Cython for ALL supported platforms, so we have them in the sdist.\n        # the sdist does not require Cython at install time, so we need all as C.\n        cythonize([posix_ext, linux_ext, syncfilerange_ext, freebsd_ext, darwin_ext, windows_ext], **cython_opts)\n        # generate C code from Cython for THIS platform (and for all platform-independent Cython parts).\n        ext_modules = cythonize(ext_modules, **cython_opts)\n\n\nsetup(\n    name='borgbackup',\n    use_scm_version={\n        'write_to': 'src/borg/_version.py',\n    },\n    author='The Borg Collective (see AUTHORS file)',\n    author_email='borgbackup@python.org',\n    url='https://borgbackup.readthedocs.io/',\n    description='Deduplicated, encrypted, authenticated and compressed backups',\n    long_description=setup_docs.long_desc_from_readme(),\n    license='BSD',\n    platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],\n    classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Environment :: Console',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: POSIX :: BSD :: FreeBSD',\n        'Operating System :: POSIX :: BSD :: OpenBSD',\n        'Operating System :: POSIX :: BSD :: NetBSD',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: POSIX :: Linux',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n        'Topic :: Security :: Cryptography',\n        'Topic :: System :: Archiving :: Backup',\n    ],\n    packages=find_packages('src'),\n    package_dir={'': 'src'},\n    zip_safe=False,\n    entry_points={\n        'console_scripts': [\n            'borg = borg.archiver:main',\n            'borgfs = borg.archiver:main',\n        ]\n    },\n    # See also the MANIFEST.in file.\n    # We want to install all the files in the package directories...\n    include_package_data=True,\n    # ...except the source files which have been compiled (C extensions):\n    exclude_package_data={\n        '': ['*.c', '*.h', '*.pyx', ],\n    },\n    cmdclass=cmdclass,\n    ext_modules=ext_modules,\n    setup_requires=['setuptools_scm>=1.7'],\n    install_requires=install_requires,\n    extras_require=extras_require,\n    python_requires='>=3.8',\n)\n", "path": "setup.py"}], "after_files": [{"content": "# borgbackup - main setup code (see also other setup_*.py files)\n\nimport os\nimport sys\nfrom collections import defaultdict\nfrom glob import glob\n\ntry:\n    import multiprocessing\nexcept ImportError:\n    multiprocessing = None\n\nfrom setuptools.command.build_ext import build_ext\nfrom setuptools import setup, find_packages, Extension, Command\nfrom setuptools.command.sdist import sdist\n\ntry:\n    from Cython.Build import cythonize\nexcept ImportError:\n    cythonize = None\n\nimport setup_checksums\nimport setup_compress\nimport setup_crypto\nimport setup_docs\n\nis_win32 = sys.platform.startswith('win32')\n\n# How the build process finds the system libs / uses the bundled code:\n#\n# 1. it will try to use (system) libs (see 1.1. and 1.2.),\n#    except if you use these env vars to force using the bundled code:\n#    BORG_USE_BUNDLED_XXX undefined  -->  try using system lib\n#    BORG_USE_BUNDLED_XXX=YES        -->  use the bundled code\n#    Note: do not use =NO, that is not supported!\n# 1.1. if BORG_LIBXXX_PREFIX is set, it will use headers and libs from there.\n# 1.2. if not and pkg-config can locate the lib, the lib located by\n#      pkg-config will be used. We use the pkg-config tool via the pkgconfig\n#      python package, which must be installed before invoking setup.py.\n#      if pkgconfig is not installed, this step is skipped.\n# 2. if no system lib could be located via 1.1. or 1.2., it will fall back\n#    to using the bundled code.\n\n# OpenSSL is required as a (system) lib in any case as we do not bundle it.\n# Thus, only step 1.1. and 1.2. apply to openssl (but not 1. and 2.).\n# needed: openssl >=1.0.2 or >=1.1.0 (or compatible)\nsystem_prefix_openssl = os.environ.get('BORG_OPENSSL_PREFIX')\n\n# needed: lz4 (>= 1.7.0 / r129)\nprefer_system_liblz4 = not bool(os.environ.get('BORG_USE_BUNDLED_LZ4'))\nsystem_prefix_liblz4 = os.environ.get('BORG_LIBLZ4_PREFIX')\n\n# needed: zstd (>= 1.3.0)\nprefer_system_libzstd = not bool(os.environ.get('BORG_USE_BUNDLED_ZSTD'))\nsystem_prefix_libzstd = os.environ.get('BORG_LIBZSTD_PREFIX')\n\nprefer_system_libxxhash = not bool(os.environ.get('BORG_USE_BUNDLED_XXHASH'))\nsystem_prefix_libxxhash = os.environ.get('BORG_LIBXXHASH_PREFIX')\n\n# Number of threads to use for cythonize, not used on windows\ncpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing.get_start_method() != 'spawn' else None\n\n# Are we building on ReadTheDocs?\non_rtd = os.environ.get('READTHEDOCS')\n\ninstall_requires = [\n    # we are rather picky about msgpack versions, because a good working msgpack is\n    # very important for borg, see: https://github.com/borgbackup/borg/issues/3753\n    'msgpack >=0.5.6, <=1.0.3, !=1.0.1',\n    # Please note:\n    # using any other version is not supported by borg development and\n    # any feedback related to issues caused by this will be ignored.\n    'packaging',\n]\n\n# note for package maintainers: if you package borgbackup for distribution,\n# please (if available) add pyfuse3 (preferably) or llfuse (not maintained any more)\n# as a *requirement*. \"borg mount\" needs one of them to work.\n# if neither is available, do not require it, most of borgbackup will work.\nextras_require = {\n    'llfuse': [\n        'llfuse >= 1.3.8',\n    ],\n    'pyfuse3': [\n        'pyfuse3 >= 3.1.1',\n    ],\n    'nofuse': [],\n}\n\ncompress_source = 'src/borg/compress.pyx'\ncrypto_ll_source = 'src/borg/crypto/low_level.pyx'\ncrypto_helpers = 'src/borg/crypto/_crypto_helpers.c'\nchunker_source = 'src/borg/chunker.pyx'\nhashindex_source = 'src/borg/hashindex.pyx'\nitem_source = 'src/borg/item.pyx'\nchecksums_source = 'src/borg/algorithms/checksums.pyx'\nplatform_posix_source = 'src/borg/platform/posix.pyx'\nplatform_linux_source = 'src/borg/platform/linux.pyx'\nplatform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'\nplatform_darwin_source = 'src/borg/platform/darwin.pyx'\nplatform_freebsd_source = 'src/borg/platform/freebsd.pyx'\nplatform_windows_source = 'src/borg/platform/windows.pyx'\n\ncython_sources = [\n    compress_source,\n    crypto_ll_source,\n    chunker_source,\n    hashindex_source,\n    item_source,\n    checksums_source,\n\n    platform_posix_source,\n    platform_linux_source,\n    platform_syncfilerange_source,\n    platform_freebsd_source,\n    platform_darwin_source,\n    platform_windows_source,\n]\n\nif cythonize:\n    Sdist = sdist\nelse:\n    class Sdist(sdist):\n        def __init__(self, *args, **kwargs):\n            raise Exception('Cython is required to run sdist')\n\n    cython_c_files = [fn.replace('.pyx', '.c') for fn in cython_sources]\n    if not on_rtd and not all(os.path.exists(path) for path in cython_c_files):\n        raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')\n\n\ndef rm(file):\n    try:\n        os.unlink(file)\n        print('rm', file)\n    except FileNotFoundError:\n        pass\n\n\nclass Clean(Command):\n    user_options = []\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def run(self):\n        for source in cython_sources:\n            genc = source.replace('.pyx', '.c')\n            rm(genc)\n            compiled_glob = source.replace('.pyx', '.cpython*')\n            for compiled in sorted(glob(compiled_glob)):\n                rm(compiled)\n\n\ncmdclass = {\n    'build_ext': build_ext,\n    'build_usage': setup_docs.build_usage,\n    'build_man': setup_docs.build_man,\n    'sdist': Sdist,\n    'clean2': Clean,\n}\n\next_modules = []\nif not on_rtd:\n\n    def members_appended(*ds):\n        result = defaultdict(list)\n        for d in ds:\n            for k, v in d.items():\n                assert isinstance(v, list)\n                result[k].extend(v)\n        return result\n\n    try:\n        import pkgconfig as pc\n    except ImportError:\n        print('Warning: can not import pkgconfig python package.')\n        pc = None\n\n    crypto_ext_kwargs = members_appended(\n        dict(sources=[crypto_ll_source, crypto_helpers]),\n        setup_crypto.crypto_ext_kwargs(pc, system_prefix_openssl),\n    )\n\n    compress_ext_kwargs = members_appended(\n        dict(sources=[compress_source]),\n        setup_compress.lz4_ext_kwargs(pc, prefer_system_liblz4, system_prefix_liblz4),\n        setup_compress.zstd_ext_kwargs(pc, prefer_system_libzstd, system_prefix_libzstd,\n                                       multithreaded=False, legacy=False),\n    )\n\n    checksums_ext_kwargs = members_appended(\n        dict(sources=[checksums_source]),\n        setup_checksums.xxhash_ext_kwargs(pc, prefer_system_libxxhash, system_prefix_libxxhash),\n    )\n\n    ext_modules += [\n        Extension('borg.crypto.low_level', **crypto_ext_kwargs),\n        Extension('borg.compress', **compress_ext_kwargs),\n        Extension('borg.hashindex', [hashindex_source]),\n        Extension('borg.item', [item_source]),\n        Extension('borg.chunker', [chunker_source]),\n        Extension('borg.algorithms.checksums', **checksums_ext_kwargs),\n    ]\n\n    posix_ext = Extension('borg.platform.posix', [platform_posix_source])\n    linux_ext = Extension('borg.platform.linux', [platform_linux_source], libraries=['acl'])\n    syncfilerange_ext = Extension('borg.platform.syncfilerange', [platform_syncfilerange_source])\n    freebsd_ext = Extension('borg.platform.freebsd', [platform_freebsd_source])\n    darwin_ext = Extension('borg.platform.darwin', [platform_darwin_source])\n    windows_ext = Extension('borg.platform.windows', [platform_windows_source])\n\n    if not is_win32:\n        ext_modules.append(posix_ext)\n    else:\n        ext_modules.append(windows_ext)\n    if sys.platform == 'linux':\n        ext_modules.append(linux_ext)\n        ext_modules.append(syncfilerange_ext)\n    elif sys.platform.startswith('freebsd'):\n        ext_modules.append(freebsd_ext)\n    elif sys.platform == 'darwin':\n        ext_modules.append(darwin_ext)\n\n    # sometimes there's no need to cythonize\n    # this breaks chained commands like 'clean sdist'\n    cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (\n        ('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]\n\n    if cythonize and cythonizing:\n        cython_opts = dict(\n            # default language_level will be '3str' starting from Cython 3.0.0,\n            # but old cython versions (< 0.29) do not know that, thus we use 3 for now.\n            compiler_directives={'language_level': 3},\n        )\n        if not is_win32:\n            # compile .pyx extensions to .c in parallel, does not work on windows\n            cython_opts['nthreads'] = cpu_threads\n\n        # generate C code from Cython for ALL supported platforms, so we have them in the sdist.\n        # the sdist does not require Cython at install time, so we need all as C.\n        cythonize([posix_ext, linux_ext, syncfilerange_ext, freebsd_ext, darwin_ext, windows_ext], **cython_opts)\n        # generate C code from Cython for THIS platform (and for all platform-independent Cython parts).\n        ext_modules = cythonize(ext_modules, **cython_opts)\n\n\nsetup(\n    name='borgbackup',\n    use_scm_version={\n        'write_to': 'src/borg/_version.py',\n    },\n    author='The Borg Collective (see AUTHORS file)',\n    author_email='borgbackup@python.org',\n    url='https://borgbackup.readthedocs.io/',\n    description='Deduplicated, encrypted, authenticated and compressed backups',\n    long_description=setup_docs.long_desc_from_readme(),\n    license='BSD',\n    platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Console',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: POSIX :: BSD :: FreeBSD',\n        'Operating System :: POSIX :: BSD :: OpenBSD',\n        'Operating System :: POSIX :: BSD :: NetBSD',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: POSIX :: Linux',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n        'Topic :: Security :: Cryptography',\n        'Topic :: System :: Archiving :: Backup',\n    ],\n    packages=find_packages('src'),\n    package_dir={'': 'src'},\n    zip_safe=False,\n    entry_points={\n        'console_scripts': [\n            'borg = borg.archiver:main',\n            'borgfs = borg.archiver:main',\n        ]\n    },\n    # See also the MANIFEST.in file.\n    # We want to install all the files in the package directories...\n    include_package_data=True,\n    # ...except the source files which have been compiled (C extensions):\n    exclude_package_data={\n        '': ['*.c', '*.h', '*.pyx', ],\n    },\n    cmdclass=cmdclass,\n    ext_modules=ext_modules,\n    setup_requires=['setuptools_scm>=1.7'],\n    install_requires=install_requires,\n    extras_require=extras_require,\n    python_requires='>=3.8',\n)\n", "path": "setup.py"}]}