pypas-cli 0.4.0__tar.gz → 0.4.2__tar.gz

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 (22) hide show
  1. {pypas_cli-0.4.0/src/pypas_cli.egg-info → pypas_cli-0.4.2}/PKG-INFO +1 -1
  2. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/pyproject.toml +1 -1
  3. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/config.py +6 -2
  4. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/exercise.py +6 -1
  5. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/main.py +0 -1
  6. {pypas_cli-0.4.0 → pypas_cli-0.4.2/src/pypas_cli.egg-info}/PKG-INFO +1 -1
  7. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/LICENSE +0 -0
  8. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/README.md +0 -0
  9. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/setup.cfg +0 -0
  10. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/__init__.py +0 -0
  11. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/auth.py +0 -0
  12. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/console.py +0 -0
  13. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/decorators.py +0 -0
  14. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/monads.py +0 -0
  15. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/network.py +0 -0
  16. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/lib/sysutils.py +0 -0
  17. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas/settings.py +0 -0
  18. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas_cli.egg-info/SOURCES.txt +0 -0
  19. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas_cli.egg-info/dependency_links.txt +0 -0
  20. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas_cli.egg-info/entry_points.txt +0 -0
  21. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas_cli.egg-info/requires.txt +0 -0
  22. {pypas_cli-0.4.0 → pypas_cli-0.4.2}/src/pypas_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypas-cli
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Python Practical Assignments
5
5
  Author-email: Sergio Delgado Quintero <sdelquin@gmail.com>
6
6
  Maintainer-email: Sergio Delgado Quintero <sdelquin@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pypas-cli"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "Python Practical Assignments"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -57,5 +57,9 @@ class Config:
57
57
  return None
58
58
 
59
59
  @staticmethod
60
- def local_config_exists(config_file: str = settings.EXERCISE_CONFIG_FILE) -> bool:
61
- return Path(config_file).exists()
60
+ def local_config_exists(
61
+ config_file: str = settings.EXERCISE_CONFIG_FILE, ignore_main_config: bool = False
62
+ ) -> bool:
63
+ return Path(config_file).exists() and (
64
+ ignore_main_config or Path('.').resolve() != settings.MAIN_CONFIG_FILE.parent.resolve()
65
+ )
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import filecmp
3
4
  import os
4
5
  import shutil
5
6
  import subprocess
@@ -102,7 +103,11 @@ class Exercise:
102
103
  for filename in files:
103
104
  file = Path(dirpath) / filename
104
105
  rel_file = file.relative_to(src_dir)
105
- if backup and rel_file.exists() and backup_files.match_file(str(rel_file)):
106
+ if (
107
+ backup
108
+ and backup_files.match_file(str(rel_file))
109
+ and not filecmp.cmp(rel_file, file, shallow=False)
110
+ ):
106
111
  backup_file = rel_file.with_suffix(rel_file.suffix + '.bak')
107
112
  console.debug(f'Backup {rel_file} → {backup_file}')
108
113
  shutil.copy(rel_file, backup_file)
@@ -92,7 +92,6 @@ def auth(token: str = typer.Argument(help='Access token')):
92
92
 
93
93
 
94
94
  @app.command()
95
- @check_version
96
95
  def upgrade():
97
96
  """Upgrade pypas-cli from PyPI."""
98
97
  if sysutils.upgrade_pypas():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypas-cli
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Python Practical Assignments
5
5
  Author-email: Sergio Delgado Quintero <sdelquin@gmail.com>
6
6
  Maintainer-email: Sergio Delgado Quintero <sdelquin@gmail.com>
File without changes
File without changes
File without changes