partis-pyproj 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/__init__.py +9 -1
  2. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/_legacy_setup.py +11 -11
  3. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/_nonprintable.py +4 -3
  4. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/backend.py +44 -37
  5. partis_pyproj-0.1.6.data/purelib/partis/pyproj/builder/builder.py +351 -0
  6. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/builder/cargo.py +2 -2
  7. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/builder/cmake.py +9 -15
  8. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/builder/meson.py +5 -13
  9. partis_pyproj-0.1.6.data/purelib/partis/pyproj/builder/process.py +42 -0
  10. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/__init__.py +1 -1
  11. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_base.py +75 -86
  12. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_binary.py +6 -24
  13. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_copy.py +7 -18
  14. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_source.py +4 -21
  15. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_targz.py +5 -12
  16. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/dist_file/dist_zip.py +5 -14
  17. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/file.py +2 -1
  18. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/legacy.py +3 -2
  19. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/load_module.py +7 -6
  20. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/norms.py +35 -31
  21. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/path/__init__.py +2 -1
  22. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/path/match.py +42 -35
  23. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/path/pattern.py +60 -54
  24. partis_pyproj-0.1.6.data/purelib/partis/pyproj/path/utils.py +94 -0
  25. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/pep.py +36 -35
  26. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/pkginfo.py +7 -16
  27. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/pptoml.py +125 -120
  28. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/pyproj.py +47 -36
  29. partis_pyproj-0.1.6.data/purelib/partis/pyproj/template.py +229 -0
  30. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/validate.py +273 -268
  31. partis_pyproj-0.1.6.dist-info/METADATA +500 -0
  32. partis_pyproj-0.1.6.dist-info/RECORD +37 -0
  33. partis_pyproj-0.1.4.data/purelib/partis/pyproj/builder/builder.py +0 -267
  34. partis_pyproj-0.1.4.data/purelib/partis/pyproj/builder/process.py +0 -75
  35. partis_pyproj-0.1.4.data/purelib/partis/pyproj/path/utils.py +0 -40
  36. partis_pyproj-0.1.4.dist-info/METADATA +0 -51
  37. partis_pyproj-0.1.4.dist-info/RECORD +0 -36
  38. {partis_pyproj-0.1.4.data → partis_pyproj-0.1.6.data}/purelib/partis/pyproj/builder/__init__.py +0 -0
  39. {partis_pyproj-0.1.4.dist-info → partis_pyproj-0.1.6.dist-info}/LICENSE.txt +0 -0
  40. {partis_pyproj-0.1.4.dist-info → partis_pyproj-0.1.6.dist-info}/WHEEL +0 -0
  41. {partis_pyproj-0.1.4.dist-info → partis_pyproj-0.1.6.dist-info}/entry_points.txt +0 -0
  42. {partis_pyproj-0.1.4.dist-info → partis_pyproj-0.1.6.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  import sys
2
3
  import os
3
4
  import os.path as osp
@@ -36,13 +37,13 @@ from .validate import (
36
37
  mapget,
37
38
  as_list)
38
39
 
39
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40
+ #===============================================================================
40
41
  CompatibilityTags = namedtuple('CompatibilityTags', ['py_tag', 'abi_tag', 'plat_tag'])
41
42
 
42
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
43
+ #===============================================================================
43
44
  # NOTE: patterns used for validation are defined at the end of this file
44
45
 
45
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
46
+ #===============================================================================
46
47
  class PEPValidationError( ValidationError ):
47
48
  """Error from value incompatible with a :term:`PEP`
48
49
 
@@ -63,7 +64,7 @@ class PEPValidationError( ValidationError ):
63
64
  super().__init__(
64
65
  msg = f'{msg} (PEP {pep}): {val}' )
65
66
 
66
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
67
+ #===============================================================================
67
68
  def norm_printable(
68
69
  text = None ):
69
70
  r"""Removes leading and trailing whitespace and all non-printable characters,
@@ -112,7 +113,7 @@ def norm_printable(
112
113
 
113
114
  return nonprintable.sub( '', str(text).strip() )
114
115
 
115
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
116
+ #===============================================================================
116
117
  def valid_dist_name( name ):
117
118
  """Checks for valid distribution name (:pep:`426`)
118
119
 
@@ -131,7 +132,7 @@ def valid_dist_name( name ):
131
132
 
132
133
  return name
133
134
 
134
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
135
+ #===============================================================================
135
136
  def norm_dist_name( name ):
136
137
  """Normalizes a distribution name (:pep:`503`)
137
138
 
@@ -154,7 +155,7 @@ def norm_dist_name( name ):
154
155
 
155
156
  return name
156
157
 
157
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
158
+ #===============================================================================
158
159
  def norm_dist_filename( name ):
159
160
  """Normalize distribution filename component (:pep:`427`)
160
161
 
@@ -170,7 +171,7 @@ def norm_dist_filename( name ):
170
171
 
171
172
  return re.sub( r"[^\w\d\.]+", "_", name )
172
173
 
173
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
174
+ #===============================================================================
174
175
  def join_dist_filename( parts ):
175
176
  """Joins distribution filename component (:pep:`427`)
176
177
 
@@ -189,7 +190,7 @@ def join_dist_filename( parts ):
189
190
  for p in parts
190
191
  if p != ''])
191
192
 
192
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
193
+ #===============================================================================
193
194
  def norm_dist_version( version ):
194
195
  """Checks for valid distribution version (:pep:`440`)
195
196
 
@@ -209,7 +210,7 @@ def norm_dist_version( version ):
209
210
 
210
211
  return version
211
212
 
212
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
213
+ #===============================================================================
213
214
  def norm_dist_author(
214
215
  name = None,
215
216
  email = None ):
@@ -262,7 +263,7 @@ def norm_dist_author(
262
263
  # > as appropriate.
263
264
  return name, email
264
265
 
265
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
266
+ #===============================================================================
266
267
  def norm_dist_author_dict(val):
267
268
 
268
269
  name = norm_printable( val.get('name', '') )
@@ -309,7 +310,7 @@ def norm_dist_author_dict(val):
309
310
 
310
311
  return val
311
312
 
312
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
313
+ #===============================================================================
313
314
  def norm_dist_classifier( classifier ):
314
315
  """
315
316
  See Also
@@ -332,7 +333,7 @@ def norm_dist_classifier( classifier ):
332
333
 
333
334
  return classifier
334
335
 
335
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
336
+ #===============================================================================
336
337
  def norm_dist_keyword( keyword ):
337
338
  """
338
339
  See Also
@@ -350,7 +351,7 @@ def norm_dist_keyword( keyword ):
350
351
 
351
352
  return keyword
352
353
 
353
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
354
+ #===============================================================================
354
355
  def norm_dist_url( label, url ):
355
356
  """
356
357
  See Also
@@ -385,7 +386,7 @@ def norm_dist_url( label, url ):
385
386
 
386
387
  return label, url
387
388
 
388
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
389
+ #===============================================================================
389
390
  def norm_dist_extra( extra ):
390
391
  """Normalize distribution 'extra' requirement
391
392
 
@@ -404,7 +405,7 @@ def norm_dist_extra( extra ):
404
405
 
405
406
  return extra
406
407
 
407
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
408
+ #===============================================================================
408
409
  def dist_build( build_number = None, build_tag = None ):
409
410
  if build_number is None and build_tag is None:
410
411
  build = ''
@@ -420,7 +421,7 @@ def dist_build( build_number = None, build_tag = None ):
420
421
 
421
422
  return norm_dist_build(build)
422
423
 
423
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
424
+ #===============================================================================
424
425
  def norm_dist_build( build ):
425
426
  """
426
427
  Note
@@ -443,7 +444,7 @@ def norm_dist_build( build ):
443
444
 
444
445
  return build
445
446
 
446
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
447
+ #===============================================================================
447
448
  def norm_dist_compat( py_tag, abi_tag, plat_tag ):
448
449
  """
449
450
 
@@ -500,7 +501,7 @@ def norm_dist_compat( py_tag, abi_tag, plat_tag ):
500
501
 
501
502
  return CompatibilityTags( py_tag, abi_tag, plat_tag )
502
503
 
503
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
504
+ #===============================================================================
504
505
  def join_dist_compat( tags ):
505
506
  """
506
507
  See Also
@@ -509,7 +510,7 @@ def join_dist_compat( tags ):
509
510
  """
510
511
  return '.'.join( sorted(list(set(tags))) )
511
512
 
512
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
513
+ #===============================================================================
513
514
  def compress_dist_compat( compat ):
514
515
  """
515
516
  See Also
@@ -525,7 +526,7 @@ def compress_dist_compat( compat ):
525
526
 
526
527
  return py_tags, abi_tags, plat_tags
527
528
 
528
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
529
+ #===============================================================================
529
530
  def purelib_compat_tags():
530
531
  """Return general compatability tags for the current system
531
532
  """
@@ -534,7 +535,7 @@ def purelib_compat_tags():
534
535
 
535
536
  return compat
536
537
 
537
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
538
+ #===============================================================================
538
539
  def platlib_compat_tags():
539
540
  """Get platform compatability tags for the current system
540
541
  """
@@ -547,7 +548,7 @@ def platlib_compat_tags():
547
548
 
548
549
  return compat_tags
549
550
 
550
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
551
+ #===============================================================================
551
552
  def norm_py_identifier( name ):
552
553
 
553
554
  name = norm_printable( name )
@@ -564,7 +565,7 @@ def norm_py_identifier( name ):
564
565
 
565
566
  return name
566
567
 
567
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
568
+ #===============================================================================
568
569
  def norm_entry_point_group( name ):
569
570
  """Normalizes entry point group
570
571
 
@@ -582,7 +583,7 @@ def norm_entry_point_group( name ):
582
583
 
583
584
  return name
584
585
 
585
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
586
+ #===============================================================================
586
587
  def norm_entry_point_name( name ):
587
588
  """Normalizes entry point name
588
589
 
@@ -600,7 +601,7 @@ def norm_entry_point_name( name ):
600
601
 
601
602
  return name
602
603
 
603
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
604
+ #===============================================================================
604
605
  def norm_entry_point_ref( ref ):
605
606
  """Normalizes entry point object reference
606
607
 
@@ -633,7 +634,7 @@ def norm_entry_point_ref( ref ):
633
634
  msg = f"""Entry point reference must have the form 'importable.module'
634
635
  or 'importable.module:object.attr': {ref}""") from e
635
636
 
636
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
637
+ #===============================================================================
637
638
  pep426_dist_name = re.compile(
638
639
  r'^([A-Z0-9]|[A-Z0-9][A-Z0-9._\-]*[A-Z0-9])$',
639
640
  re.IGNORECASE )
@@ -641,7 +642,7 @@ pep426_dist_name = re.compile(
641
642
  pep440_version = re.compile(
642
643
  r'^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*'
643
644
  r'((a|b|rc)(0|[1-9][0-9]*))?'
644
- '(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$' )
645
+ r'(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$' )
645
646
 
646
647
  # NOTE: PEP 427 does not specify any constraints on the string following the
647
648
  # digits, but given the form it is used in the filenames it really cannot
@@ -654,7 +655,7 @@ pep425_pytag = re.compile(
654
655
  r'^([A-Z0-9_]+)$',
655
656
  re.IGNORECASE )
656
657
 
657
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
658
+ #===============================================================================
658
659
  # https://www.python.org/dev/peps/pep-0621/#authors-maintainers
659
660
  # https://www.rfc-editor.org/rfc/inline-errata/rfc5322.html
660
661
  # > name value MUST be a valid email name (i.e. whatever can be put as a name,
@@ -691,7 +692,7 @@ common_plattag = {
691
692
  re.IGNORECASE ),
692
693
  'local' : re.compile( rf'^({local_plat})$', re.IGNORECASE )}
693
694
 
694
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
695
+ #===============================================================================
695
696
  # https://www.python.org/dev/peps/pep-0301/#distutils-trove-classification
696
697
  # > It was decided that strings would be used for the classification entries
697
698
  # > due to the deep nesting that would be involved in a more formal Python
@@ -707,17 +708,17 @@ pep_301_classifier = re.compile(
707
708
  r'^[A-Z0-9._\-\/\[\]\(\) ]+$',
708
709
  re.IGNORECASE )
709
710
 
710
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
711
+ #===============================================================================
711
712
  # https://packaging.python.org/en/latest/specifications/core-metadata/#keywords
712
713
  # https://www.python.org/dev/peps/pep-0621/#keywords
713
714
  # NOTE: does not say what is a valid keyword, but does say they are comma separted,
714
715
  # and other implemented with space separated. To be safe ensure no white-space or commas
715
716
  pep_621_keyword = re.compile( r'^[^\s\,]+$' )
716
717
 
717
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
718
+ #===============================================================================
718
719
  pep_621_extra = re.compile( r'^([A-Z0-9_]+)?$', re.IGNORECASE )
719
720
 
720
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
721
+ #===============================================================================
721
722
  # https://packaging.python.org/en/latest/specifications/entry-points/
722
723
  # Group names must be one or more groups of letters, numbers and underscores,
723
724
  # separated by dots
@@ -726,11 +727,11 @@ entry_point_group = re.compile( r'^[A-Z0-9_]+(\.[A-Z0-9_]+)*$', re.IGNORECASE )
726
727
  # underscores, dots and dashes
727
728
  entry_point_name = re.compile( r'^([A-Z0-9_\.\-]+)?$', re.IGNORECASE )
728
729
 
729
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
730
+ #===============================================================================
730
731
  py_keyword = re.compile( '^(' + '|'.join(keyword.kwlist) + ')$' )
731
732
  py_identifier = re.compile( r'^[A-Z_][A-Z0-9_]*$', re.IGNORECASE )
732
733
 
733
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
734
+ #===============================================================================
734
735
  # NOTE: there may be a more efficient way to strip all non-printable characters
735
736
  # Here consider new-lines '\n' and tabs '\t' to be printable
736
737
  # even though '\n'.isprintable() returns False
@@ -1,13 +1,8 @@
1
+ from __future__ import annotations
1
2
  import os
2
- import os.path as osp
3
-
4
3
  import io
5
- import warnings
6
- import stat
7
4
  from copy import copy
8
5
  import re
9
- import tempfile
10
- import shutil
11
6
  import configparser
12
7
 
13
8
  from pathlib import (
@@ -15,10 +10,6 @@ from pathlib import (
15
10
  PurePath,
16
11
  PurePosixPath)
17
12
 
18
- from collections.abc import (
19
- Mapping,
20
- Sequence )
21
-
22
13
  from .validate import (
23
14
  ValidationError,
24
15
  validating,
@@ -58,7 +49,7 @@ from packaging.requirements import Requirement
58
49
  from packaging.specifiers import SpecifierSet
59
50
  from packaging.markers import Marker
60
51
 
61
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
52
+ #===============================================================================
62
53
  class EntryPointsParser(configparser.ConfigParser):
63
54
  """
64
55
 
@@ -68,7 +59,7 @@ class EntryPointsParser(configparser.ConfigParser):
68
59
  """
69
60
  optionxform = staticmethod(str)
70
61
 
71
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62
+ #===============================================================================
72
63
  class PkgInfoAuthor:
73
64
  """Internal container for normalizing Author/Maintainer
74
65
  and Author-email/Maintainer-email header metadata
@@ -98,7 +89,7 @@ class PkgInfoAuthor:
98
89
  def __hash__( self ):
99
90
  return hash(str(self))
100
91
 
101
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92
+ #===============================================================================
102
93
  class PkgInfoURL:
103
94
  """Internal container for normalizing Project-URL
104
95
  """
@@ -120,7 +111,7 @@ class PkgInfoURL:
120
111
  def __hash__( self ):
121
112
  return hash(str(self))
122
113
 
123
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
114
+ #===============================================================================
124
115
  class PkgInfoReq:
125
116
  """Internal container for normalizing "Requires-Dist" header metadata
126
117
  """
@@ -150,7 +141,7 @@ class PkgInfoReq:
150
141
  def __hash__( self ):
151
142
  return hash(str(self))
152
143
 
153
- #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
144
+ #===============================================================================
154
145
  class PkgInfo:
155
146
  def __init__( self,
156
147
  project,
@@ -310,7 +301,7 @@ class PkgInfo:
310
301
 
311
302
  self.license_file = os.fspath(PurePosixPath(self.license.file))
312
303
 
313
- license_file = root.joinpath(self.license.file)
304
+ license_file = root.joinpath(self.license.file)
314
305
 
315
306
  if not license_file.exists():
316
307
  raise ValidationError(