From 3185f0c2127a42f8358b39a7b973fa02a5f1e499 Mon Sep 17 00:00:00 2001 From: Chris Mutel Date: Mon, 20 May 2024 17:28:02 -0400 Subject: [PATCH] Fix #60 --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/python-package-deploy.yml | 9 +- .github/workflows/python-test.yml | 6 +- .isort.cfg | 2 - .pre-commit-config.yaml | 34 +++++-- .readthedocs.yml | 2 +- CHANGES.md | 4 + MANIFEST.in | 1 - pyproject.toml | 104 ++++++++++++++++++- pytest.ini | 4 - setup.cfg | 105 -------------------- 11 files changed, 142 insertions(+), 129 deletions(-) create mode 100644 .DS_Store delete mode 100644 .isort.cfg delete mode 100644 pytest.ini delete mode 100644 setup.cfg diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9c7e095a39565e9fec75f52b03c6c0fb8e8f112e GIT binary patch literal 6148 zcmeHKOG-mQ5Uh>?1KDKha!w$4gCQg*$OR+_QIH5?vVNBc8SOA#O9dYt7Ha~YC*`zW?r1Oqv9I!oZ-uJI>qw4Dk=icHTJG|iI zJAc2+Td&iUl>$;g3P=GdAO(J@fcIY7Y@Vnn1*Cu!I4j`ahemhog+pR|Iv8REAWoSM z<2q&uV)F#C7Y>Qc&@8FMq*{#_mUQM@)%C(5G3l@xKCGT>HKABMo%gpWhxJ57DIf(d z6}ZXm!u$W4{=@u#NzzUVNP&N)fK6AM)snANy>;|*-fJ8Ek?u90bT_Vp!VvA4810xF fZ^w60ly%M5Jnw}=V$hinI#E9Zu8T|x{IvpK{InHg literal 0 HcmV?d00001 diff --git a/.github/workflows/python-package-deploy.yml b/.github/workflows/python-package-deploy.yml index 834f942..a188e7d 100644 --- a/.github/workflows/python-package-deploy.yml +++ b/.github/workflows/python-package-deploy.yml @@ -13,11 +13,11 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@master - - name: Set up Python 3.10 + - uses: actions/checkout@v4 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install pypa/build run: >- python -m @@ -33,7 +33,8 @@ jobs: - name: Publish distribution 📦 to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - skip_existing: true + repository-url: https://test.pypi.org/legacy/ + skip-existing: true - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 27d1e89..571134e 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -15,7 +15,6 @@ on: - "**.ya?ml" # captures both .yml and .yaml - "LICENSE" - ".gitignore" - - "README.md" pull_request: branches: [main, develop] types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs @@ -25,7 +24,6 @@ on: - "**.ya?ml" - "LICENSE" - ".gitignore" - - "README.md" workflow_dispatch: # also allow manual trigger, for testing purposes jobs: @@ -34,8 +32,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: [ubuntu-latest, windows-latest, macos-13, ubuntu-20.04, macos-latest, windows-2019] + py-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index b9fb3f3..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[settings] -profile=black diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c199fe6..a2ea3a9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: '^docs/conf.py' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: check-added-large-files @@ -28,16 +28,23 @@ repos: # --remove-unused-variables, # ] +# https://github.com/PyCQA/flake8/issues/234 +- repo: https://github.com/john-hen/Flake8-pyproject + rev: 1.2.3 + hooks: + - id: Flake8-pyproject + - repo: https://github.com/pycqa/isort - rev: 5.11.5 + rev: 5.13.2 hooks: - id: isort + args: [--settings-path=pyproject.toml] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 24.1.1 hooks: - id: black - language_version: python3 + args: [--config=pyproject.toml] ## If like to embrace black styles even in the docs: # - repo: https://github.com/asottile/blacken-docs @@ -47,9 +54,22 @@ repos: # additional_dependencies: [black] - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 - args: ["--ignore=E501"] - ## You can add flake8 plugins via `additional_dependencies`: + additional_dependencies: [Flake8-pyproject] + # You can add flake8 plugins via `additional_dependencies`: # additional_dependencies: [flake8-bugbear] + +- repo: local + hooks: + - id: pylint + name: pylint + entry: pylint + language: system + types: [python] + args: + [ + "-rn", # Only display messages + "-sn", # Don't display the score + ] diff --git a/.readthedocs.yml b/.readthedocs.yml index ab0d333..4709c49 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,7 +6,7 @@ version: 2 conda: - environment: docs/environment.yaml + environment: environment.yaml sphinx: configuration: docs/conf.py diff --git a/CHANGES.md b/CHANGES.md index fb40176..4a58f4a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # `bw_processing` Changelog +## DEV + +* Changed packaging + ### [0.9.3] - 2024-05-12 * Fix compatibility function for datetime utcnow for older Python versions diff --git a/MANIFEST.in b/MANIFEST.in index b362a38..b4809dd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ -include bw_processing/VERSION include bw_processing/examples/simple.zip recursive-exclude dev * diff --git a/pyproject.toml b/pyproject.toml index 638dd9c..c1247af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,105 @@ [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools>=68.0"] build-backend = "setuptools.build_meta" + +[project] +name = "bw_processing" +authors = [ + { name="Chris Mutel", email="cmutel@gmail.com" } +] +maintainers = [ + { name="Chris Mutel", email="cmutel@gmail.com" } +] +description = "Foo" +readme = "README.md" +dynamic = ["version"] +# Add here all kinds of additional classifiers as defined under +# https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering" +] +requires-python = ">=3.9" +dependencies = [ + # dependencies as strings with quotes, e.g. "foo" + # You can add version requirements + "fs", + "numpy", + "pandas", + +] + +[project.urls] +source = "https://github.com/brightway-lca/bw_processing" +homepage = "https://github.com/brightway-lca/bw_processing" +tracker = "https://github.com/brightway-lca/bw_processing/issues" + +[project.optional-dependencies] +# Getting recursive dependencies to work is a pain, this +# seems to work, at least for now +testing = [ + "bw_processing", + "pytest", + "pytest-cov", + "python-coveralls" +] +dev = [ + "build", + "pre-commit", + "pylint", + "pytest", + "pytest-cov", + "pytest-randomly", + "setuptools", +] + +[tool.setuptools] +license-files = ["LICENSE"] +include-package-data = true +packages = ["bw_processing"] + +[tool.setuptools.dynamic] +version = {attr = "bw_processing.__version__"} + +[tool.pytest.ini_options] +addopts = "--cov bw_processing --cov-report term-missing --verbose" +norecursedirs = [ + "dist", + "build", + ".tox" +] +testpaths = ["tests/*.py"] + +[tool.flake8] +# Some sane defaults for the code style checker flake8 +max_line_length = 100 +extend_ignore = ["E203", "W503"] +# ^ Black-compatible +# E203 and W503 have edge cases handled by black +exclude = [ + ".tox", + "build", + "dist", + ".eggs", + "docs/conf.py", +] + +[tool.black] +line-length = 100 + +[tool.isort] +profile = "black" +line_length = 100 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index fc1dbdf..0000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -testpaths = tests -python_files = tests/*.py -norecursedirs = venv, manual diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 554bc9f..0000000 --- a/setup.cfg +++ /dev/null @@ -1,105 +0,0 @@ -[metadata] -name = bw-processing -version = attr: bw_processing.__version__ -description = Tools to create structured arrays in a common format -author = Chris Mutel -maintainer = Chris Mutel -maintainer_email = -author_email = -license = BSD-3-Clause -license_files = LICENSE -long_description = file: README.md -long_description_content_type = text/markdown; charset=UTF-8 -keywords= "brightway", "development" -url = https://github.com/brightway-lca/bw_processing -# Add here related links, for example: -project_urls = - source = https://github.com/brightway-lca/bw_processing - homepage = https://github.com/brightway-lca/bw_processing - tracker = https://github.com/brightway-lca/bw_processing/issues - -# Conda-Forge = https://anaconda.org/conda-forge/bw_processing -# Download = https://pypi.org/project/bw_processing/#files - -# Change if running only on Windows, Mac or Linux (comma-separated) -platforms = any - -# Add here all kinds of additional classifiers as defined under -# https://pypi.org/classifiers/ -classifiers = - Development Status :: 4 - Beta - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - - -[options] -zip_safe = False -packages = find_namespace: -include_package_data = True -package_dir = - =. - -# Require a min/specific Python version (comma-separated conditions) -python_requires = >=3.8 - -install_requires = - fs - numpy - pandas - -[options.packages.find] -where = . -exclude = - tests - -[options.extras_require] -# Add here additional requirements for extra features, to install with: -# `pip install samplepyscaffoldproject[PDF]` like: -# PDF = ReportLab; RXP - -# Add here test requirements (semicolon/line-separated) -testing = - setuptools - pytest - pytest-cov - pyarrow - -dev = - pre-commit - pylint - -docs = - sphinx - myst_parser - furo - -[tool:pytest] -addopts = - --cov bw_processing --cov-report term-missing - --verbose -norecursedirs = - dist - build - .tox -testpaths = tests - -[devpi:upload] -no_vcs = 1 -formats = bdist_wheel - -[flake8] -# Some sane defaults for the code style checker flake8 -max_line_length = 88 -extend_ignore = E203, W503 -# ^ Black-compatible -# E203 and W503 have edge cases handled by black -exclude = - .tox - build - dist - .eggs - docs/conf.py