Skip to content

Commit

Permalink
Rename to forest-analysis and migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
hackdna committed Nov 21, 2024
1 parent 90ba45a commit ae6f171
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 57 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ jobs:
if: ${{ startsWith(matrix.os, 'windows') }}
uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
- name: Install Forest
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements.txt
- name: Install Forest and optional development dependencies
run: pip install -e ".[dev]"
- name: Run code style checking
run: flake8
- name: Run static type checking
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
__pycache__/
dist/
/forest_analysis.egg-info

.vagrant/
.venv/
.DS_Store

# IntelliJ, VsCode project files
.idea
.vscode

# for installing Forest in editable mode when developing
/forest.egg-info/

#We don't want to add data to github
/tutorials/data/
/tutorials/comm_output/
Expand Down
20 changes: 18 additions & 2 deletions docs/source/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Information for contributors

## Quick start
* Change current directory to the top level of your local Forest repository
* Install Forest in editable mode: `pip install -e .`
* Install development tools: `pip install -r requirements.txt`
* Install Forest in editable mode along with development tools: `pip install -e ".[dev]"`
* Run code style checks: `flake8`
* Run type hint checks: `mypy -p forest`
* Run test suite: `pytest`
Expand Down Expand Up @@ -44,6 +43,23 @@ Open `docs/_build/html/index.html` in a web browser to check the results
* Use the [logging module](https://docs.python.org/3/library/logging.html) instead of `print()`
* [Formatting log messages](http://reinout.vanrees.org/weblog/2015/06/05/logging-formatting.html): `logger.info("%s went %s wrong", 42, 'very')`
* Continue writing code and comments all the way until the end of the line then indent appropriately
* [Packaging Python Projects](https://packaging.python.org/en/latest/tutorials/packaging-projects)

### Packaging and distribution

#### Python Package Index
* Use [TestPyPI](https://test.pypi.org/) for testing that your package can be uploaded, downloaded, and installed correctly
* [Register an account](https://test.pypi.org/account/register/)
* [Create an API token](https://test.pypi.org/manage/account/#api-tokens) (setting the "Scope" to "Entire account")
* [Add API token](https://packaging.python.org/en/latest/specifications/pypirc/#using-a-pypi-token) to your `$HOME/.pypirc` file
* Generate distribution archives: `python -m build`
* Check the results: `twine check dist/*`
* Upload distribution archives:
* TestPyPI: `twine upload --repository testpypi dist/*`
* PyPI: `twine upload dist/*`
* Install from TestPyPI to verify:
* TestPyPI: `pip install --index-url https://test.pypi.org/simple/ --no-deps forest-analysis`
* PyPI: `pip install forest-analysis`

## GitHub

Expand Down
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "forest-analysis"
version = "0.1.1"
description = "--add description here--"
readme = "README.md"
license = { file = "LICENSE.md" }
authors = [
{ name = "Onnela Lab", email = "[email protected]" }
]
dependencies = [
"holidays", # poplar
"librosa", # audio file durations in sycamore
"numpy",
"openrouteservice",
"pandas",
"pyproj", # jasmine
"pytz", # jasmine, poplar
"ratelimit",
"requests", # bonsai
"scipy",
"shapely", # jasmine
"ssqueezepy", # oak
"timezonefinder", # poplar, bonsai
]
requires-python = ">=3.11"

[project.urls]
Homepage = "https://github.com/onnela-lab/forest"

[project.optional-dependencies]
dev = [
"build",
"flake8==6.1.0",
"flake8-pytest-style==1.7.2",
"mypy==1.6.1",
"pytest==7.4.3",
"pytest-mock==3.12.0",
"twine",
"types-python-dateutil==2.8.19.14",
"types-pytz==2023.3.1.1",
"types-requests==2.31.0.10",
"types-setuptools==68.2.0.0"
]

[tool.setuptools.packages.find]
include = ["forest*"]

[tool.setuptools.package-data]
"forest.poplar.raw" = ["noncode/*.csv", "noncode/*.json"]
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

39 changes: 0 additions & 39 deletions setup.py

This file was deleted.

0 comments on commit ae6f171

Please sign in to comment.