Skip to content

Commit

Permalink
upgrade to pyproject format
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwols committed Jan 16, 2025
1 parent 96f5b0c commit cacceb6
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 64 deletions.
46 changes: 26 additions & 20 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,33 @@ name: Upload Python Package
on:
release:
types: [created]
push:
tags:
- "v*"

jobs:
deploy:
runs-on: ubuntu-latest

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build Wheel
run: |
python setup.py sdist bdist_wheel
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build the package
run: python -m build
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,10 @@ ENV/
# mypy
.mypy_cache/

scratch.ipynb
scratch.py



.DS_Store
.cadence/
30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "yann"
version = "0.0.40"
description = "yet another neural network library"
readme = "README.md"
license = { text = "MIT" }
authors = [
{ name = "Michal Wolski", email = "[email protected]" }
]
requires-python = ">=3.7"
dependencies = [
"numpy",
"scipy",
"scikit-learn",
"torch>=1.0.0",
"matplotlib",
"torchvision",
"tqdm"
]

[project.optional-dependencies]
cli = ["click>=6.7"]
pretrainedmodels = ["pretrainedmodels"]

[project.scripts]
yann = "yann.cli:main"
2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function watch-tests() {
function release() {
rm -rf ./dist
rm -rf ./build
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
}

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
url = https://github.com/michalwols/yann
43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

0 comments on commit cacceb6

Please sign in to comment.