Skip to content

Commit

Permalink
Fix: pyproj toml deps and small package update
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Dec 14, 2023
1 parent 520aada commit 3b9596f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 32 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 11 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]
maintainers = [
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{}'"
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

4 changes: 3 additions & 1 deletion src/pyosmeta/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import urllib.request

import ruamel.yaml
from ruamel.yaml import YAML
from typing import Dict, List, Union


Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3b9596f

Please sign in to comment.