diff --git a/.gitignore b/.gitignore index 9dad33e..2f6eecb 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,12 @@ token.txt src/test-model.py src/pyosmeta/_version_generated.py .pdm-build/* + +# local files +all-submissions.csv +issue-stats.ipynb +plot.py +presubmissions.csv +reviews_all.csv +reviews_presubmissions.csv +src/pyosmeta/cli/test.ipynb diff --git a/README.md b/README.md index 082ee89..f162671 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,14 @@ contributor search and filter functionality that you can see here.](https://www. To begin: 1. Create a local environment and activate it. -2. Install the required dependencies via the `requirement.txt` file by running the following command; - `pip install -r requirements.txt` -3. Install the pyosmeta package in development/editable mode: - `pip install -e . ` +If you are using conda: + +```bash +mamba create -n pyos-meta python=3.10 +mamba activate pyos-meta +```` +2. Install the package in editable model and associated development dependencies: + `pip install -e ".[dev]"` ### Setup token to authenticate with the GitHub API diff --git a/pyproject.toml b/pyproject.toml index c4b45d5..f90b1fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["pdm-backend"] -build-backend = "pdm.backend" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "pyosmeta" -dynamic = ["version"] +version = "0.1" description = "Tools that update the pyOpenSci contributor and review metadata that is posted on our website" authors = [{ name = "Leah Wasser", email = "leah@pyopensci.org" }] maintainers = [ @@ -37,13 +37,21 @@ dependencies = [ "requests", "python-dotenv", "pydantic>=2.0", + "requests", + "python-dotenv" ] + # This is the metadata that pip reads to understand what versions your package supports requires-python = ">=3.10" readme = "README.md" license = { text = "MIT" } + +[project.optional-dependencies] +dev = [ + "pre-commit" +] # Examples listed include a pattern for specifying where the package tracks # issues, where the source is hosted, where to say thanks to the package # maintainers, and where to support the project financially. The key is @@ -80,20 +88,3 @@ py_version = 27 # but why did it ignore it? [tool.flake8] extend-ignore = ["E203", "W503"] - - -[tool.pdm.build] -excludes = ["./**/.git"] -# This config is important for telling pdm that the package should live in -# a src directory -package-dir = "src" - -# Versioning is a backend feature - instructions are in pdm-backend docs -# https://pdm-backend.fming.dev/metadata/ - -[tool.pdm.version] -# Note that you need to create the tag after all commits are created - otherwise -# pdm adds dev info after the tag number which won't publish to pypi -source = "scm" -write_to = "pyosmeta/_version_generated.py" -write_template = "__version__ = 'v{}'" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index be433a7..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -ruamel.yaml -pre-commit -requests -python-dotenv - -# Build requirements -pdm diff --git a/src/pyosmeta/file_io.py b/src/pyosmeta/file_io.py index 8521477..d747ab5 100644 --- a/src/pyosmeta/file_io.py +++ b/src/pyosmeta/file_io.py @@ -2,6 +2,7 @@ import urllib.request import ruamel.yaml +from ruamel.yaml import YAML from typing import Dict, List, Union @@ -73,7 +74,8 @@ def open_yml_file(file_path: str) -> dict: # the contrib class try: with urllib.request.urlopen(file_path) as f: - return ruamel.yaml.safe_load(f) + yaml = YAML(typ="safe", pure=True) + return yaml.load(f) except urllib.error.URLError as url_error: print("Oops - can find the url", file_path, url_error)