Skip to content

Commit

Permalink
Adopt pyproject.toml, revert changes for mypyc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoPrevato committed Dec 18, 2022
1 parent 3714790 commit 778f956
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 124 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/build-manylinux-wheels.sh

This file was deleted.

64 changes: 14 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build

on:
workflow_dispatch:
release:
types: [published]
push:
Expand All @@ -10,11 +9,10 @@ on:
- ci
paths-ignore:
- README.md
- CHANGELOG.md
pull_request:
branches:
- "*"
paths-ignore:
- README.md

env:
PROJECT_NAME: rodi
Expand All @@ -27,14 +25,17 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v1
with:
fetch-depth: 9
submodules: false

- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
- uses: actions/cache@v1
id: depcache
with:
path: deps
Expand Down Expand Up @@ -77,60 +78,23 @@ jobs:
bash <(curl -s https://codecov.io/bash)
- name: Install distribution dependencies
run: pip install --upgrade twine setuptools wheel
if: matrix.python-version == 3.9 || matrix.python-version == 3.10
run: pip install --upgrade build
if: matrix.python-version == 3.10

- name: Create distribution package
run: python setup.py sdist bdist_wheel
if: matrix.python-version == 3.9 || matrix.python-version == 3.10
run: python -m build
if: matrix.python-version == 3.10

build-wheels:
needs: build
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Build wheels (linux)
if: startsWith(matrix.os, 'ubuntu')
uses: docker://quay.io/pypa/manylinux2014_x86_64
env:
PYTHON_VERSION: ${{ matrix.python-version }}
with:
entrypoint: /github/workspace/.github/workflows/build-manylinux-wheels.sh

- name: Build wheels (non-linux)
if: "!startsWith(matrix.os, 'ubuntu')"
run: |
python -m pip install --upgrade setuptools pip wheel mypy
python setup.py bdist_wheel
- uses: actions/upload-artifact@v1
- name: Upload distribution package
uses: actions/upload-artifact@master
with:
name: dist
path: dist

- name: Test wheels
if: |
!startsWith(matrix.os, 'windows')
run: |
pip install rodi -f "file:///${GITHUB_WORKSPACE}/dist"
pip freeze | grep rodi
if: matrix.python-version == 3.10

publish:
runs-on: ubuntu-latest
needs: [build, build-wheels]
needs: build
if: github.event_name == 'release'
steps:
- name: Download a distribution artifact
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ __pycache__
*.tar.gz
.mypy_cache
build
dist
*.py,cover
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.4] - 2022-12-05 :star:
- Merges [MaximZayats´](https://github.com/MaximZayats) contribution, to
improve performance using `mypyc`
- Modifies the GitHub Workflow to build and distribute compiled `wheels`
## [1.1.4] - ??? :star:
- Replaces `setup.py` with `pyproject.toml`

## [1.1.3] - 2022-03-27 :droplet:
- Corrects a bug that would cause false positives when raising exceptions
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


artifacts: test
python setup.py sdist bdist_wheel
python -m build


clean:
Expand All @@ -13,12 +13,12 @@ prepforbuild:
pip install --upgrade twine setuptools wheel


uploadtest:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
test-release:
twine upload --repository testpypi dist/*


release: clean artifacts
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
release:
twine upload --repository pypi dist/*


test:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
injection, like _[inject](https://pypi.org/project/Inject/)_)
* minimum overhead to obtain services, once the objects graph is built
* support for singletons, transient, and scoped services
* using `mypyc` for improved performance (see [#19](https://github.com/Neoteroi/rodi/issues/19))

This library is freely inspired by .NET Standard
`Microsoft.Extensions.DependencyInjection` implementation (_ref. [MSDN,
Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "rodi"
dynamic = ["version"]
authors = [
{ name = "Roberto Prevato", email = "[email protected]" },
]
description = "Implementation of dependency injection for Python 3"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
]
keywords = ["dependency", "injection", "type", "hints", "typing"]

[tool.hatch.version]
path = "rodi/__about__.py"

[project.urls]
"Homepage" = "https://github.com/Neoteroi/rodi"
"Bug Tracker" = "https://github.com/Neoteroi/rodi/issues"
1 change: 1 addition & 0 deletions rodi/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.1.4"
38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

0 comments on commit 778f956

Please sign in to comment.