diff --git a/.github/workflows/docs-publish.yml.disabled b/.github/workflows/docs-publish.yml similarity index 100% rename from .github/workflows/docs-publish.yml.disabled rename to .github/workflows/docs-publish.yml diff --git a/.github/workflows/python-publish.yml.disabled b/.github/workflows/python-publish.yml similarity index 95% rename from .github/workflows/python-publish.yml.disabled rename to .github/workflows/python-publish.yml index 2529b95..94ba549 100644 --- a/.github/workflows/python-publish.yml.disabled +++ b/.github/workflows/python-publish.yml @@ -37,4 +37,4 @@ jobs: with: repository_url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.API_TOKEN }} diff --git a/.github/workflows/test-pytest.yml.disabled b/.github/workflows/test-pytest.yml similarity index 100% rename from .github/workflows/test-pytest.yml.disabled rename to .github/workflows/test-pytest.yml diff --git a/mkdocs.yml b/mkdocs.yml index b2d949c..d0a6d98 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,9 +26,9 @@ extra_javascript: [ ] site_name: Contributor Onboarding -repo_url: 'https://github.com/GITHUBUSERNAME/contributor-onboarding' +repo_url: 'https://github.com/anishhs001/contributor-onboarding' nav: - Home: 'index.md' - Resources: - - 'resources/github-basics.md' \ No newline at end of file + - 'resources/github-basics.md' diff --git a/pyproject.toml b/pyproject.toml index 9681ccb..1aeb7a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "practice-project" +name = "practice-project-ASD-v1.0.0" description = "A practice project for open-source development" authors = [] dynamic = ["version"] @@ -24,8 +24,8 @@ test = [ ] [project.urls] -repository = "https://github.com/GITHUBUSERNAME/contributor-onboarding" -documentation = "https://GITHUBUSERNAME.github.io/contributor-onboarding/" +repository = "https://github.com/anishhs001/contributor-onboarding" +documentation = "https://anishhs001.github.io/contributor-onboarding/" [build-system] requires = ["setuptools", "setuptools_scm"] diff --git a/src/utils.py b/src/utils.py index faae9e3..12cdcae 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,7 +41,11 @@ def divide(a: float, b: float) -> float: Returns: float ''' - return a / b + + if b!=0: + return a / b + else: + print("b shouldn't be zero") def modulo(a: int, b: int): ''' @@ -91,7 +95,8 @@ def return_hexadecimal(a: int) -> float: return hex(a) -def return_random_number() -> int: +def return_random_number(a: int, b:int, seed:int) -> int: + ''' ... @@ -103,4 +108,5 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + np.random.seed(seed) + return np.random.randint(a, b) diff --git a/tests/Test_return_random_number.py b/tests/Test_return_random_number.py new file mode 100644 index 0000000..b6ac062 --- /dev/null +++ b/tests/Test_return_random_number.py @@ -0,0 +1,7 @@ +from src.utils import return_random_number + +try: + return_random_number(0,200, 45) + print("The return_random_number function works") +except: + print("We have an issue with return_random_number function") diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..fb01633 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +from utils import sum, multiply, divide \ No newline at end of file diff --git a/tests/test_hexadecimal.py b/tests/test_hexadecimal.py new file mode 100644 index 0000000..ace9728 --- /dev/null +++ b/tests/test_hexadecimal.py @@ -0,0 +1,6 @@ +from src.utils import return_hexadecimal +def test_hexadecimal(): + a = 2 + b = 3 + + assert return_hexadecimal(a) == hex(a) diff --git a/tests/test_sum.py b/tests/test_sum.py new file mode 100644 index 0000000..322aae7 --- /dev/null +++ b/tests/test_sum.py @@ -0,0 +1,6 @@ +from src.utils import sum +def test_sum(): + a = 2 + b = 3 + + assert sum(a, b) == 5