Skip to content

Commit

Permalink
Replace package configuration with hatch pypackage.toml
Browse files Browse the repository at this point in the history
```
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      running egg_info
      /home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/dist.py:548: UserWarning: The version specified ('0.1.0-110-g5533981') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-lc_t92jl/setup.py", line 121, in <module>
          setup(
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command
          super().run_command(command)
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.ensure_finalized()
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
          parsed_version = parse_version(self.egg_version)
        File "/home/matt/bin/mambaforge/envs/oai-analysis-2/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.1.0-110-g5533981'
      [end of output]
```
  • Loading branch information
thewtex committed Feb 2, 2023
1 parent 243ad53 commit 117870d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 17 deletions.
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies:
- python=3.8
- pytorch-gpu
- pip
- git
- pip:
- itk==5.3.0
- coiled-runtime
Expand Down
1 change: 1 addition & 0 deletions oai_analysis_2/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1.0'
5 changes: 0 additions & 5 deletions oai_analysis_2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
__version__ = '0.1.0'

#from .analysis_object import AnalysisObject
#from oai_analysis_2 import mesh_processing

62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "oai-analysis-2"
description = 'Open source analysis approaches for the Osteoarthritis Initiative magnetic resonance image data.'
readme = "README.md"
requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = []
authors = [
{ name = "Hastings Greer", email = "hastings.greer@gmail.com" },
{ name = "Pranjal Sahu", email = "pranjalsahu5@gmail.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []
dynamic = ["version"]

[project.urls]
Documentation = "https://github.com/uncbiag/OAI_analysis_2#readme"
Issues = "https://github.com/uncbiag/OAI_analysis_2/issues"
Source = "https://github.com/uncbiag/OAI_analysis_2"

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

[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
]
[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=oai_analysis_2 --cov=tests {args}"
no-cov = "cov --no-cov {args}"

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]

[tool.coverage.run]
branch = true
parallel = true
omit = [
"oai_analysis_2/__about__.py",
]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
11 changes: 0 additions & 11 deletions setup.py

This file was deleted.

0 comments on commit 117870d

Please sign in to comment.