diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8f1271d..e9bb0c9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,11 @@ version: 2 updates: - - package-ecosystem: "github-actions" + - package-ecosystem: github-actions # Workflow files in .github/workflows will be checked directory: "/" schedule: - interval: "daily" + interval: daily + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e05a927..ccf6f5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,16 @@ -name: later_ci +name: later on: [push, pull_request] jobs: build: - name: Running python ${{ matrix.python-version }} on ${{matrix.os}} + name: test runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, '3.10', 3.11] - os: [ubuntu-latest] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -19,17 +20,13 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: update pip + setuptools + - name: update pip run: | - python -m pip install --upgrade coverage pip setuptools - - - name: pip install requirements - run: | - python -m pip install -r requirements.txt + python -m pip install --upgrade pip - name: pip install later run: | - python -m pip install -e . + python -m pip install -e .[dev] - name: Run Unitests via coverage run: | diff --git a/.gitignore b/.gitignore index 969e7f6..9007e24 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ target/ #Ipython Notebook .ipynb_checkpoints +.python-version .venv .venv37 .mypy_cache diff --git a/later/__init__.py b/later/__init__.py index 2ba38f0..a98ed65 100644 --- a/later/__init__.py +++ b/later/__init__.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +"""A toolbox for asyncio services""" + from async_timeout import timeout from .event import BiDirectionalEvent diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..df700d7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["flit-core >= 3.8"] +build-backend = "flit_core.buildapi" + +[project] +name = "later" +dynamic = ["version", "description"] +readme = "README.rst" +authors = [ + {name="Meta Platforms, Inc"}, + {name="Jason Fried", email="fried@meta.com"}, +] +license = {file="LICENSE"} +keywords = ["asyncio", "later"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: AsyncIO", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: Apache Software License", + "Operating System :: POSIX", + "Operating System :: MacOS :: MacOS X", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Testing", +] + +requires-python = ">=3.7" +dependencies = [ + "async-timeout >= 2.0.0, < 5.0.0", +] + +[project.optional-dependencies] +dev = [ + "async-timeout==3.0.1", + "coverage==4.5.4", +] + +[project.urls] +Github = "https://github.com/facebookincubator/later" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index c86e8eb..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -coverage==4.5.4 - diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1a4933c..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -async-timeout==3.0.1 diff --git a/setup.cfg b/setup.cfg index 3097eeb..c970efc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[metadata] -license_file = LICENSE - [tox:tox] envlist = py37, py37-minimal, py38 diff --git a/setup.py b/setup.py deleted file mode 100644 index d08e3a7..0000000 --- a/setup.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License - -import ast -import os -import re -import sys - -from setuptools import find_packages, setup - - -assert sys.version_info >= (3, 7, 0), "later requires Python >=3.7" -THISDIR = os.path.abspath(os.path.dirname(__file__)) - - -def long_desc() -> str: - with open(os.path.join(THISDIR, "README.rst"), "r") as f: - return f.read() - - -def version() -> str: - _version_re = re.compile(r"__version__\s+=\s+(?P.*)") - - with open(os.path.join(THISDIR, "later", "__init__.py"), "r") as f: - version = _version_re.search(f.read()).group("version") - return str(ast.literal_eval(version)) - - -setup( - name="later", - version=version(), - license="Apache 2.0", - url="https://github.com/facebookincubator/later", - description="A toolbox for asyncio services", - long_description=long_desc(), - keywords=["asyncio", "later"], - author="Jason Fried, Facebook", - author_email="fried@fb.com", - zip_safe=True, - packages=find_packages(include=["later.*", "later"]), - python_requires=">3.7", - test_suite="later.tests.base", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Framework :: AsyncIO", - "License :: OSI Approved :: Apache Software License", - "Operating System :: POSIX", - "Operating System :: MacOS :: MacOS X", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Software Development :: Testing", - ], - install_requires=["async-timeout >=2.0.0,<5.0.0"], - # Per PEP 561 - package_data={"later": ["py.typed"]}, - include_package_data=True, -)