Skip to content

Commit

Permalink
fixed issue with upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pancht committed Mar 6, 2024
1 parent c1df2d1 commit 56c67c2
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 52 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
[//]: <> (The format is based on Keep a Changelog keepachangelog.com/)
[//]: <> (and this project adheres to Semantic Versioning semver.org/)

### [2024.25.6] - On 2024.03.06

#### Fixed
- [Issue with upgrade](https://github.com/pancht/ngrobo/issues/87)

### [2024.25.0] - On 2024.03.04

#### Added
Expand Down
76 changes: 38 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,80 +327,80 @@ Features
- Percent
- Download Count
* - US
- 41.43%
- 19,609
- 41.38%
- 19,662
* - CN
- 12.95%
- 6,129
- 13.01%
- 6,182
* - RU
- 5.30%
- 2,510
- 2,517
* - SG
- 5.15%
- 2,436
- 5.14%
- 2,442
* - DE
- 3.99%
- 1,889
- 3.98%
- 1,891
* - HK
- 3.84%
- 1,819
- 3.83%
- 1,821
* - JP
- 3.19%
- 1,512
- 3.24%
- 1,540
* - FR
- 3.02%
- 1,428
- 3.01%
- 1,431
* - CA
- 2.85%
- 1,350
- 1,353
* - KR
- 2.76%
- 2.75%
- 1,307
* - AU
- 1.85%
- 1.84%
- 876
* - GB
- 1.83%
- 867
- 869
* - NO
- 1.68%
- 797
* - IN
- 1.57%
- 744
- 746
* - SE
- 1.30%
- 614
- 1.29%
- 615
* - HR
- 0.83%
- 394
- 396
* - TH
- 0.81%
- 385
* - TW
- 0.76%
- 362
* - DK
- 0.69%
- 0.68%
- 325
* - IE
- 0.67%
- 317
* - IL
- 0.57%
- 273
* - ES
- 0.55%
- 262
* - IL
- 0.53%
- 253
* - NL
- 0.51%
- 241
* - CH
- 0.43%
- 202
- 203
* - AE
- 0.36%
- 171
- 173
* - FI
- 0.19%
- 90
Expand All @@ -416,19 +416,19 @@ Features
* - TR
- 0.09%
- 44
* - OM
* - CZ
- 0.09%
- 42
* - IS
- 0.09%
- 42
* - CZ
* - OM
- 0.09%
- 42
* - BR
* - RO
- 0.05%
- 24
* - RO
* - BR
- 0.05%
- 24
* - UA
Expand All @@ -440,25 +440,25 @@ Features
* - CY
- 0.01%
- 6
* - EE
* - AR
- 0.01%
- 3
* - AR
* - EE
- 0.01%
- 3
* - SK
- 0.00%
- 2
* - PT
* - MX
- 0.00%
- 1
* - RS
- 0.00%
- 1
* - MX
* - PT
- 0.00%
- 1
* - **Total**
- **100.00%**
- **47,332**
- **47,519**

File renamed without changes.
53 changes: 53 additions & 0 deletions key/download-stats/2024_03_06_2047.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Served from cache: False
Data processed: 9.19 GiB
Data billed: 9.19 GiB
Estimated cost: $0.05

| country | percent | download_count |
| ------- | ------- | -------------- |
| US | 41.38% | 19,662 |
| CN | 13.01% | 6,182 |
| RU | 5.30% | 2,517 |
| SG | 5.14% | 2,442 |
| DE | 3.98% | 1,891 |
| HK | 3.83% | 1,821 |
| JP | 3.24% | 1,540 |
| FR | 3.01% | 1,431 |
| CA | 2.85% | 1,353 |
| KR | 2.75% | 1,307 |
| AU | 1.84% | 876 |
| GB | 1.83% | 869 |
| NO | 1.68% | 797 |
| IN | 1.57% | 746 |
| SE | 1.29% | 615 |
| HR | 0.83% | 396 |
| TH | 0.81% | 385 |
| TW | 0.76% | 362 |
| DK | 0.68% | 325 |
| IE | 0.67% | 317 |
| IL | 0.57% | 273 |
| ES | 0.55% | 262 |
| NL | 0.51% | 241 |
| CH | 0.43% | 203 |
| AE | 0.36% | 173 |
| FI | 0.19% | 90 |
| ZA | 0.19% | 89 |
| PL | 0.13% | 61 |
| CW | 0.09% | 44 |
| TR | 0.09% | 44 |
| CZ | 0.09% | 42 |
| IS | 0.09% | 42 |
| OM | 0.09% | 42 |
| RO | 0.05% | 24 |
| BR | 0.05% | 24 |
| UA | 0.02% | 8 |
| GF | 0.01% | 6 |
| CY | 0.01% | 6 |
| AR | 0.01% | 3 |
| EE | 0.01% | 3 |
| SK | 0.00% | 2 |
| MX | 0.00% | 1 |
| RS | 0.00% | 1 |
| PT | 0.00% | 1 |
| Total | | 47,519 |

5 changes: 2 additions & 3 deletions nrobo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@email: erpanchdev@gmail.com
"""

__version__ = '2024.25.1'
__version__ = '2024.25.6'

# install rich library
import os
Expand Down Expand Up @@ -83,7 +83,7 @@ class EnvKeys:
os.environ[EnvKeys.BROWSER] = ""
os.environ[EnvKeys.HOST_PLATFORM] = ""
os.environ[EnvKeys.DEBUG] = "False"
os.environ[EnvKeys.SUPPRESS_PROMPT] = "1"
os.environ[EnvKeys.SUPPRESS_PROMPT] = "0"


class NROBO_PATHS:
Expand Down Expand Up @@ -253,6 +253,5 @@ def set_environment() -> None:
# grab nrobo installation path
os.environ[EnvKeys.NROBO_DIR] = re.findall(f"(.*{NROBO_CONST.NROBO})", str(nrobo_loader_file_path))[0]

from nrobo import NROBO_PATHS
NROBO_PATHS.EXEC_DIR = Path(os.environ[EnvKeys.EXEC_DIR])
NROBO_PATHS.NROBO_DIR = Path(os.environ[EnvKeys.NROBO_DIR])
15 changes: 9 additions & 6 deletions nrobo/cli/install/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ def transfer_files_to_host_project() -> None:
patch_2024_6_12 = NP.NROBO_DIR / "patch_2024_6_12"
patch_2024_19_5 = NP.NROBO_DIR / NP.PATCHES / "2024.19.5"

if patch_2024_19_5.exists():
if patch_2024_19_5.exists() and host_version < Version("2024.20.0"):
return
else:

if host_version < Version("2024.20.0"):
# apply patch for 2024.19.4
# [NewFile] Copy browserConfigs/markers.yaml to user's project dir from nrobo
copy_file(NP.NROBO_DIR / NP.MARKERS_YAML
Expand All @@ -63,19 +64,21 @@ def transfer_files_to_host_project() -> None:
print("\n")
exit(1)

if patch_2024_6_12.exists():
if patch_2024_6_12.exists() and host_version < Version("2024.7.0"):
return
else:

if host_version < Version("2024.7.0"):
if Version(get_host_version()) == Version("2024.6.12"):
from nrobo.util.filesystem import remove_file
if patch_2024_6_10.exists():
remove_file(patch_2024_6_10)
# Create new patch file
Common.write_text_to_file(NP.NROBO_DIR / "patch_2024_6_12", "")

if patch_2024_6_10.exists():
if patch_2024_6_10.exists() and host_version < Version("2024.7.0"):
return
else:

if host_version < Version("2024.7.0"):
# Apply patches

if Version(get_host_version()) == Version("2024.6.10"):
Expand Down
4 changes: 3 additions & 1 deletion nrobo/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def launcher_command(exit_on_failure=True):
if type(value) is bool or isinstance(value, bool):
"""if a bool key is found, only add key to the launcher command, not the value
and proceed with next key"""
if key == nCLI.SUPPRESS or key == nCLI.FULLPAGE_SCREENSHOT or key == BoolArgs.PYARGS:
if key == nCLI.FULLPAGE_SCREENSHOT or key == BoolArgs.PYARGS:
continue
elif key == nCLI.SUPPRESS:
os.environ[EnvKeys.SUPPRESS_PROMPT] = "1"
elif key in SHOW_ONLY_SWITCHES:
terminal(['pytest', f"--{key}"], debug=True)
return None, None, None
Expand Down
7 changes: 6 additions & 1 deletion nrobo/cli/upgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def confirm_update() -> None:
terminal(['pip', 'install', '--upgrade', f'nrobo=={(host_version + 1).version}', '--require-virtualenv'],
debug=False)

if detect.production_machine() and not detect.developer_machine():
if detect.production_machine() and not detect.developer_machine()\
and host_version <= Version("2024.12.0"):
console.rule(f"[{STYLE.HLOrange}]{EXIT_CODES['10001'][1]}")
exit(EXIT_CODES['10001'][0])

Expand All @@ -110,6 +111,10 @@ def confirm_update() -> None:
if host_version < pypi_version:
# Ok. Since the host version is lower than the latest version,
# Lets' ask host user if he/she wants to upgrade.
from nrobo import EnvKeys
if int(os.environ[EnvKeys.SUPPRESS_PROMPT]):
"""Return as --suppress switch is supplied"""
return

_pypi_version = get_pypi_index(NROBO_CONST.NROBO)
from nrobo import console, terminal, STYLE
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
# Project details
[project]
name = "nrobo"
version = "2024.25.1"
version = "2024.25.6"
authors = [{name="Panchdev Singh Chauhan", email="erpanchdev@gmail.com"}]
maintainers = [{name="Panchdev Singh Chauhan", email="erpanchdev@gmail.com"}]
description = "Powerful! Yet, Easy to USE! Automated Testing Framework"
Expand Down
2 changes: 1 addition & 1 deletion versions/prod.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 2024.25.1
version: 2024.25.6
2 changes: 1 addition & 1 deletion versions/test.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 2024.25.1
version: 2024.25.6

0 comments on commit 56c67c2

Please sign in to comment.