Skip to content

Commit

Permalink
added user specified requirements.txt (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
namastey authored Mar 23, 2024
2 parents 6d508be + 6a3abf4 commit f4eecff
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 55 deletions.
94 changes: 47 additions & 47 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,80 +327,80 @@ Features
- Percent
- Download Count
* - US
- 40.07%
- 21,734
- 39.96%
- 21,816
* - CN
- 13.09%
- 7,099
- 13.04%
- 7,122
* - RU
- 5.34%
- 2,896
- 5.31%
- 2,901
* - SG
- 5.26%
- 2,853
- 5.24%
- 2,863
* - DE
- 4.85%
- 2,631
- 4.97%
- 2,713
* - HK
- 4.32%
- 2,344
- 4.30%
- 2,349
* - JP
- 3.24%
- 1,755
- 3.23%
- 1,762
* - FR
- 2.94%
- 1,594
- 2.97%
- 1,619
* - CA
- 2.79%
- 1,511
- 2.77%
- 1,515
* - KR
- 2.60%
- 2.58%
- 1,409
* - NO
- 2.03%
- 2.01%
- 1,099
* - AU
- 1.80%
- 977
* - GB
- 1.80%
- 974
- 1.94%
- 1,057
* - AU
- 1.79%
- 980
* - IN
- 1.51%
- 821
- 823
* - SE
- 1.24%
- 671
- 1.25%
- 682
* - HR
- 0.81%
- 437
- 0.80%
- 439
* - TH
- 0.80%
- 436
- 437
* - DK
- 0.73%
- 0.72%
- 395
* - TW
- 0.67%
- 0.66%
- 363
* - IE
- 0.65%
- 353
- 357
* - IL
- 0.59%
- 321
* - NL
- 0.55%
- 0.54%
- 297
* - ES
- 0.48%
- 262
* - CH
- 0.43%
- 232
- 233
* - AE
- 0.35%
- 191
- 193
* - FI
- 0.17%
- 91
Expand All @@ -413,16 +413,16 @@ Features
* - PL
- 0.11%
- 61
* - TR
* - CW
- 0.08%
- 44
* - CW
* - TR
- 0.08%
- 44
* - CZ
* - IS
- 0.08%
- 42
* - IS
* - CZ
- 0.08%
- 42
* - OM
Expand All @@ -440,25 +440,25 @@ Features
* - CY
- 0.01%
- 6
* - AR
* - EE
- 0.01%
- 3
* - EE
* - AR
- 0.01%
- 3
* - SK
- 0.00%
- 2
* - PT
* - MX
- 0.00%
- 1
* - RS
* - PT
- 0.00%
- 1
* - MX
* - RS
- 0.00%
- 1
* - **Total**
- **100.00%**
- **54,246**
- **54,598**

14 changes: 12 additions & 2 deletions framework_tests/test_package_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_cli_install_requirements_txt_file_is_present(self):
set_environment()

cli_install_requirements_txt_file_pkg_path = Path(
os.environ[EnvKeys.EXEC_DIR]) / NROBO_CONST.NROBO / NROBO_PATHS.REQUIREMENTS_TXT_FILE
os.environ[EnvKeys.EXEC_DIR]) / NROBO_CONST.NROBO / NROBO_PATHS.REQUIREMENTS_TXT_FILE_CLI

assert cli_install_requirements_txt_file_pkg_path.exists()

Expand All @@ -191,7 +191,8 @@ def test_cli_nrobo_args_pkg_is_present(self):
"""Validate that cli.nrobo_args package is present_release"""
set_environment()

cli_nrobo_args_pkg_path = Path(os.environ[EnvKeys.EXEC_DIR]) / NROBO_CONST.NROBO / NROBO_PATHS.CLI_NROBO_ARGS_PKG
cli_nrobo_args_pkg_path = Path(
os.environ[EnvKeys.EXEC_DIR]) / NROBO_CONST.NROBO / NROBO_PATHS.CLI_NROBO_ARGS_PKG

assert cli_nrobo_args_pkg_path.exists()

Expand Down Expand Up @@ -413,6 +414,15 @@ def test_framework_conftest_host_py_file_is_present(self):

assert nrobo_framework_conftest_host_py_file_path.exists()

def test_framework_requirements_txt_file_is_present(self):
"""Validate that nrobo.framework.requirements.txt file is present_release"""
set_environment()

framework_requirements_txt_file_pkg_path = Path(
os.environ[EnvKeys.EXEC_DIR]) / NROBO_CONST.NROBO / NROBO_PATHS.FRAMEWORK \
/ NROBO_PATHS.REQUIREMENTS_TXT_FILE
assert framework_requirements_txt_file_pkg_path.exists()

def test_selenes_pkg_is_present(self):
"""Validate that selenes pkg is present_release"""
set_environment()
Expand Down
File renamed without changes.
53 changes: 53 additions & 0 deletions key/download-stats/2024_03_23_5787.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Served from cache: False
Data processed: 9.72 GiB
Data billed: 9.72 GiB
Estimated cost: $0.05

| country | percent | download_count |
| ------- | ------- | -------------- |
| US | 39.96% | 21,816 |
| CN | 13.04% | 7,122 |
| RU | 5.31% | 2,901 |
| SG | 5.24% | 2,863 |
| DE | 4.97% | 2,713 |
| HK | 4.30% | 2,349 |
| JP | 3.23% | 1,762 |
| FR | 2.97% | 1,619 |
| CA | 2.77% | 1,515 |
| KR | 2.58% | 1,409 |
| NO | 2.01% | 1,099 |
| GB | 1.94% | 1,057 |
| AU | 1.79% | 980 |
| IN | 1.51% | 823 |
| SE | 1.25% | 682 |
| HR | 0.80% | 439 |
| TH | 0.80% | 437 |
| DK | 0.72% | 395 |
| TW | 0.66% | 363 |
| IE | 0.65% | 357 |
| IL | 0.59% | 321 |
| NL | 0.54% | 297 |
| ES | 0.48% | 262 |
| CH | 0.43% | 233 |
| AE | 0.35% | 193 |
| FI | 0.17% | 91 |
| ZA | 0.16% | 89 |
| BR | 0.14% | 77 |
| PL | 0.11% | 61 |
| CW | 0.08% | 44 |
| TR | 0.08% | 44 |
| IS | 0.08% | 42 |
| CZ | 0.08% | 42 |
| OM | 0.08% | 42 |
| RO | 0.04% | 24 |
| GF | 0.02% | 10 |
| UA | 0.01% | 8 |
| CY | 0.01% | 6 |
| EE | 0.01% | 3 |
| AR | 0.01% | 3 |
| SK | 0.00% | 2 |
| MX | 0.00% | 1 |
| PT | 0.00% | 1 |
| RS | 0.00% | 1 |
| Total | | 54,598 |

2 changes: 1 addition & 1 deletion 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.32.1'
__version__ = '2024.33.0'

# install rich library
import os
Expand Down
12 changes: 10 additions & 2 deletions nrobo/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def main():
from nrobo import EnvKeys, NROBO_CONST, NROBO_PATHS
from nrobo import greet_the_guest, NROBO_CONST, EnvKeys
from nrobo.cli.nrobo_args import nrobo_cli_parser
from nrobo.cli.install import install_nrobo, install_user_specified_requirements
from nrobo.cli.install import install_nrobo, \
install_user_specified_requirements, \
missing_user_files_on_production
from nrobo.util.commands.ncommands import clear_screen, remove_files_recursively
from nrobo.util.process import terminal
from nrobo.util.constants import CONST
Expand All @@ -41,13 +43,19 @@ def main():
# called to set EnvKeys dependent on args
command, args, command_builder_notes = launcher_command()
if command is None:
if missing_user_files_on_production():
install_nrobo(install_only=False)

exit(0)

# greet the guest
greet_the_guest()

# install nRoBo dependencies
install_nrobo(install_only=True)
if missing_user_files_on_production():
install_nrobo(install_only=False)
else:
install_nrobo(install_only=True)

# install user specified project dependencies
install_user_specified_requirements()
Expand Down
19 changes: 19 additions & 0 deletions nrobo/cli/install/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def transfer_files_to_host_project() -> None:
if host_version <= stop_auto_silent_update_version:
# Re-install
pass
elif missing_user_files_on_production():
pass
else:
return # Return from installation if nRoBo is already installed on HOST system! SMART! RIGHT! :)

Expand Down Expand Up @@ -265,3 +267,20 @@ def install_nrobo(requirements_file: Optional[str] = None, install_only: bool =
else:
"""fresh installation"""
transfer_files_to_host_project()


def missing_user_files_on_production():
"""Verify user files on production
Return True if specific files are present on user system
Else return False"""

from nrobo import NROBO_PATHS as NP
from nrobo.cli.upgrade import get_host_version

host_version = Version(get_host_version())
if host_version >= (Version('2024.32.3') - 1) and not (NP.EXEC_DIR / NP.REQUIREMENTS_TXT_FILE).exists():
return True

return False
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.32.1"
version = "2024.33.0"
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.32.1
version: 2024.33.0
2 changes: 1 addition & 1 deletion versions/test.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 2024.32.1
version: 2024.33.0

0 comments on commit f4eecff

Please sign in to comment.