-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added poetry for setup and workflow #5
Changes from 10 commits
b654779
b3c3f09
7fc9afc
75a5b0f
75f47b7
4163438
087f161
644ebba
3787937
c7f9eec
3b993d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "pylambertw", | ||
"postCreateCommand": "bash .devcontainer/post-create.sh", | ||
"workspaceFolder": "/workspace", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cache", | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {}, | ||
"ghcr.io/devcontainers/features/python:1": { | ||
"installTools": true, | ||
"installJupyterlab": true, | ||
"version": "3.12" | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [], | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"editor.formatOnSave": true, | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true, | ||
"source.fixAll": true | ||
}, | ||
"python.defaultInterpreterPath": "./.venv/bin/python" | ||
}, | ||
"extensions": [ | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"vscode-icons-team.vscode-icons", | ||
"wayou.vscode-todo-highlight", | ||
"timonwong.shellcheck", | ||
"charliermarsh.ruff", | ||
"ms-python.python" | ||
] | ||
} | ||
}, | ||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "vscode" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Setup poetry and install | ||
poetry config virtualenvs.in-project true | ||
poetry install --with dev | ||
|
||
# Setup and install pre-commit | ||
cd /workspace | ||
source .venv/bin/activate | ||
pre-commit install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# pdm | ||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
#pdm.lock | ||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
# in version control. | ||
# https://pdm.fming.dev/#use-with-ide | ||
.pdm.toml | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# PyCharm | ||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can | ||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
# and can be added to the global gitignore or merged into this file. For a more nuclear | ||
# option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
#.idea/ | ||
|
||
poetry.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""Version.""" | ||
|
||
__version__ = "0.0.3" | ||
__version__ = "0.0.4" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,36 @@ | ||
[tool.poetry] | ||
name = "pylambertw" | ||
version = "0.0.4" | ||
description = "Python implementation of the Lambert W x F framework for analyzing skewed, heavy-tailed distribution with an sklearn interface and torch based maximum likelihood estimation (MLE)." | ||
authors = ["Georg M. Goerg <[email protected]>"] | ||
homepage = "https://github.com/gmgeorg/pylambertw.git" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
|
||
numpy = ">=1.0.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see if you require the cython requirement (new requirements.txt file) . w/o it I had trouble with scipy CI/CD tests passing; if it passes w/o cython requirement as-is, feel free to drop that requirement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I tried it with and without that requirement and it seems the CI/CD pipeline passes in both cases. I'll leave it out for now, and if it becomes a problem later you can always add it in. |
||
scipy = ">=1.7.0" | ||
pandas = ">=1.0.0" | ||
matplotlib = ">=3.3.0" | ||
statsmodels = ">=0.12.0" | ||
seaborn = ">=0.11.1" | ||
tqdm = ">=4.62.3" | ||
dataclasses = ">=0.6" | ||
scikit-learn = ">=1.0.1" | ||
torch = ">=2.0.1" | ||
torchlambertw = { git = "https://github.com/gmgeorg/torchlambertw.git", rev = "v0.0.3" } | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = ">=6.1.1" | ||
flake8 = "^7.0.0" | ||
pre-commit = "^3.7.0" | ||
ruff = "^0.3.7" | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
|
||
fix = true | ||
|
||
|
||
[tool.ruff.per-file-ignores] | ||
"setup.py" = ['E501'] # line length violations | ||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you add this in alphabetical order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will do!