Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rye as a package manager. #46

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
12 changes: 6 additions & 6 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Thank you for considering contributing to our project! We welcome contributions

1. Fork and clone the Repository
2. Pull latest changes from the main repository if it has diverged
3. [Create a virtual environment for the project](https://docs.python.org/3/library/venv.html)
4. Install dependencies using `pip install -r requirements.txt`
5. Install pre-commit hook using `pre-commit install`
6. Run tests using `pytest tests/test_file_name.py ` or specific test name like `pytest tests/test_file_name.py::test_function_name`
7. Ensure the features is passing the acceptance criteria by `pytest test_results.py ` or `python test_results.py `
3. Add Rye on your system if it is not installed already. [Source](https://rye-up.com/guide/installation/)
4. Install all the dependencies using `rye sync`.
5. Install pre-commit hook using `rye run pre-commit install`
6. Run `rye add package_name` (if you wish to add any packages as per your requirements.) and make sure to execute ```rye sync``` to add these dependencies in your working environment.
7. Run tests using `rye run pytest` or `rye run pytest -k test_function_name -v` to run specific file.
8. Do not push changes without the tests and coverage passing
9. Commit your changes with **proper** commit messages in imperative form like `Add my best feature`, `Fix issues casusing whatever`, `Update docs` etc: [Good reference here](https://cbea.ms/git-commit/)
9. Commit your changes with **proper** commit messages in imperative form like `Add my best feature`, `Fix issues causing whatever`, `Update docs` etc: [Good reference here](https://cbea.ms/git-commit/)
10. Make changes and push to your forked repository
11. Create PR to the forked repository as mentioned below

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ scode cscode pref reason
```

## Command
You need to have [Rye](https://rye-up.com/guide/installation/) installed in your system to be able to run the project.Once you have it installed, run ```rye sync```

To run `school_center.py` use the command below:

```bash
python3 school_center.py sample_data/schools_grade12_2081.tsv sample_data/centers_grade12_2081.tsv sample_data/prefs.tsv
rye run dev
```
If you change the location of your sample files, make sure to update the command(cmd) in ```[tool.rye.scripts]``` in the ```pyproject.toml``` file with your file path and execute ```rye sync``` . If you wish to run any other files than ```school_center.py```, you can simply do ```rye run python file_name.py```

## Output

Expand Down
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[project]
name = "center-randomize"
version = "0.1.0"
description = "Exam Center Randomization Script"
authors = [
{ name = "Manisha Bhandari", email = "manishabhandari841@gmail.com" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Probably not needed, commit has all the necessary information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these informations are necessary as they serve as the main configuration of the project, but open for discussions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the author details

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project author should be moest-np.

]
dependencies = [
"streamlit-folium==0.19.1",
"folium==0.16.0",
"streamlit>=1.33.0",
]
readme = "README.md"
requires-python = ">= 3.8"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"pytest==8.0.2",
"pytest-clarity==1.0.1",
"pytest-sugar==1.0.0",
"pytest-cov==5.0.0",
"ruff==0.4.1",
"pre-commit==3.6.0",
]

[tool.rye.scripts]
dev = { cmd = "python -m school_center sample_data/schools_grade12_2081.tsv sample_data/centers_grade12_2081.tsv sample_data/prefs.tsv", env = {} }

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/center_randomize"]
161 changes: 161 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

-e file:.
altair==5.3.0
# via streamlit
attrs==23.2.0
# via jsonschema
# via referencing
blinker==1.8.1
# via streamlit
branca==0.7.2
# via folium
# via streamlit-folium
cachetools==5.3.3
# via streamlit
certifi==2024.2.2
# via requests
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via streamlit
colorama==0.4.6
# via click
# via pytest
coverage==7.5.0
# via pytest-cov
distlib==0.3.8
# via virtualenv
filelock==3.14.0
# via virtualenv
folium==0.16.0
# via center-randomize
# via streamlit-folium
gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via streamlit
identify==2.5.36
# via pre-commit
idna==3.7
# via requests
iniconfig==2.0.0
# via pytest
jinja2==3.1.3
# via altair
# via branca
# via folium
# via pydeck
# via streamlit-folium
jsonschema==4.22.0
# via altair
jsonschema-specifications==2023.12.1
# via jsonschema
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
mdurl==0.1.2
# via markdown-it-py
nodeenv==1.8.0
# via pre-commit
numpy==1.26.4
# via altair
# via folium
# via pandas
# via pyarrow
# via pydeck
# via streamlit
packaging==24.0
# via altair
# via pytest
# via pytest-sugar
# via streamlit
pandas==2.2.2
# via altair
# via streamlit
pillow==10.3.0
# via streamlit
platformdirs==4.2.1
# via virtualenv
pluggy==1.5.0
# via pytest
pprintpp==0.4.0
# via pytest-clarity
pre-commit==3.6.0
protobuf==4.25.3
# via streamlit
pyarrow==16.0.0
# via streamlit
pydeck==0.9.0
# via streamlit
pygments==2.18.0
# via rich
pytest==8.0.2
# via pytest-clarity
# via pytest-cov
# via pytest-sugar
pytest-clarity==1.0.1
pytest-cov==5.0.0
pytest-sugar==1.0.0
python-dateutil==2.9.0.post0
# via pandas
pytz==2024.1
# via pandas
pyyaml==6.0.1
# via pre-commit
referencing==0.35.1
# via jsonschema
# via jsonschema-specifications
requests==2.31.0
# via folium
# via streamlit
rich==13.7.1
# via pytest-clarity
# via streamlit
rpds-py==0.18.0
# via jsonschema
# via referencing
ruff==0.4.1
setuptools==69.5.1
# via nodeenv
six==1.16.0
# via python-dateutil
smmap==5.0.1
# via gitdb
streamlit==1.34.0
# via center-randomize
# via streamlit-folium
streamlit-folium==0.19.1
# via center-randomize
tenacity==8.2.3
# via streamlit
termcolor==2.4.0
# via pytest-sugar
toml==0.10.2
# via streamlit
toolz==0.12.1
# via altair
tornado==6.4
# via streamlit
typing-extensions==4.11.0
# via streamlit
tzdata==2024.1
# via pandas
urllib3==2.2.1
# via requests
virtualenv==20.26.1
# via pre-commit
watchdog==4.0.0
# via streamlit
xyzservices==2024.4.0
# via folium
120 changes: 120 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

-e file:.
altair==5.3.0
# via streamlit
attrs==23.2.0
# via jsonschema
# via referencing
blinker==1.8.1
# via streamlit
branca==0.7.2
# via folium
# via streamlit-folium
cachetools==5.3.3
# via streamlit
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via streamlit
colorama==0.4.6
# via click
folium==0.16.0
# via center-randomize
# via streamlit-folium
gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via streamlit
idna==3.7
# via requests
jinja2==3.1.3
# via altair
# via branca
# via folium
# via pydeck
# via streamlit-folium
jsonschema==4.22.0
# via altair
jsonschema-specifications==2023.12.1
# via jsonschema
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
mdurl==0.1.2
# via markdown-it-py
numpy==1.26.4
# via altair
# via folium
# via pandas
# via pyarrow
# via pydeck
# via streamlit
packaging==24.0
# via altair
# via streamlit
pandas==2.2.2
# via altair
# via streamlit
pillow==10.3.0
# via streamlit
protobuf==4.25.3
# via streamlit
pyarrow==16.0.0
# via streamlit
pydeck==0.9.0
# via streamlit
pygments==2.18.0
# via rich
python-dateutil==2.9.0.post0
# via pandas
pytz==2024.1
# via pandas
referencing==0.35.1
# via jsonschema
# via jsonschema-specifications
requests==2.31.0
# via folium
# via streamlit
rich==13.7.1
# via streamlit
rpds-py==0.18.0
# via jsonschema
# via referencing
six==1.16.0
# via python-dateutil
smmap==5.0.1
# via gitdb
streamlit==1.34.0
# via center-randomize
# via streamlit-folium
streamlit-folium==0.19.1
# via center-randomize
tenacity==8.2.3
# via streamlit
toml==0.10.2
# via streamlit
toolz==0.12.1
# via altair
tornado==6.4
# via streamlit
typing-extensions==4.11.0
# via streamlit
tzdata==2024.1
# via pandas
urllib3==2.2.1
# via requests
watchdog==4.0.0
# via streamlit
xyzservices==2024.4.0
# via folium
File renamed without changes.