Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update_packaging #732

Merged
merged 48 commits into from
Jan 4, 2025
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8e4c872
Do not try to set usetex=False or resave
Adamtaranto Feb 19, 2023
8029175
Replace check_call with check_out in sh()
Adamtaranto Feb 19, 2023
a5225ec
Collect stderr msgs from lastal for use in
Adamtaranto Feb 19, 2023
3f7ad6d
Log suggestion to use --notex if savefig fails
Adamtaranto Feb 19, 2023
00ff793
Add cleanup empty pdf before exit if savefig fails
Adamtaranto Feb 20, 2023
6b986bb
Merge branch 'main' of https://github.com/tanghaibao/jcvi
Adamtaranto Feb 20, 2023
e378e6f
Add logging to clarify why latex is
Adamtaranto Feb 21, 2023
2daf3dc
Merge branch 'main' of https://github.com/tanghaibao/jcvi
Adamtaranto Feb 23, 2023
ae7c0ef
Merge remote-tracking branch 'upstream/main'
Adamtaranto Nov 14, 2024
c70602a
Merge branch 'tanghaibao:main' into main
Adamtaranto Dec 25, 2024
afb75ef
ignore version and cython files
Adamtaranto Nov 14, 2024
4029d67
mv exclude to pyproject
Adamtaranto Nov 14, 2024
6a5359e
use hatch for build
Adamtaranto Nov 14, 2024
eff4eb6
use hatch-vcs version
Adamtaranto Nov 15, 2024
b77c309
log error when no cblast
Adamtaranto Nov 15, 2024
39b70d7
mv pkg into src
Adamtaranto Nov 15, 2024
60ec604
ignore version
Adamtaranto Nov 15, 2024
98752a8
init env yml
Adamtaranto Nov 15, 2024
011d467
rm version, switch to dynamic vcs version
Adamtaranto Dec 25, 2024
ed97aa1
WIP: migrating to hatch
Adamtaranto Dec 25, 2024
2678970
rm cblast.c from tracking
Adamtaranto Jan 3, 2025
b203b88
ignore dev files
Adamtaranto Jan 3, 2025
e5be700
Use setuptools for cython modules
Adamtaranto Jan 3, 2025
a640776
automate run setup.py for cython build
Adamtaranto Jan 3, 2025
e6a722b
setup_magick_home() assumes ImageMagick always installed with homebre…
Adamtaranto Jan 3, 2025
c6d1140
install non-pip deps using conda. Install libmagic without homebrew.
Adamtaranto Jan 3, 2025
66583b8
fix bug - incorrect selection of wget on MocOS without wget
Adamtaranto Jan 3, 2025
f11b1a0
version to _version
Adamtaranto Jan 3, 2025
81ab0b1
bump min Python version.
Adamtaranto Jan 3, 2025
34a5eb9
conda env instructions
Adamtaranto Jan 3, 2025
63310a7
Do not try to set usetex=False or resave
Adamtaranto Feb 19, 2023
5535264
Replace check_call with check_out in sh()
Adamtaranto Feb 19, 2023
95fe1c0
Move files back to jcvi/
Adamtaranto Jan 4, 2025
daf10f3
Move jcvi to src/ directory with git mv
Adamtaranto Jan 4, 2025
6468428
Merge branch 'main' into update_packaging
Adamtaranto Jan 4, 2025
a4c347f
optparse not used
Adamtaranto Jan 4, 2025
067553f
use logger instead of logging
Adamtaranto Jan 4, 2025
e92fa50
fix conda env to py 3.12
Adamtaranto Jan 4, 2025
c17ed8e
init pytest action
Adamtaranto Jan 4, 2025
b259642
black fmt
Adamtaranto Jan 4, 2025
0fe1336
use miniforge
Adamtaranto Jan 4, 2025
c224ef4
switch run order
Adamtaranto Jan 4, 2025
b7c6810
handle testing in build action
Adamtaranto Jan 4, 2025
7b3b890
black fmt
Adamtaranto Jan 4, 2025
a8927ec
Add cython to deps
Adamtaranto Jan 4, 2025
429ee45
typo
Adamtaranto Jan 4, 2025
bba6f13
Add cli entrypoint to check version
Adamtaranto Jan 4, 2025
b72b2c5
update readme
Adamtaranto Jan 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use setuptools for cython modules
  • Loading branch information
Adamtaranto committed Jan 3, 2025
commit e5be70067c6559c45d4b7d550809fb689dacf10d
47 changes: 10 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -3,11 +3,10 @@
requires = [
"hatchling", # Build backend
"hatch-vcs", # Version control system plugin for dynamic versioning
"hatch-cython", # Cython plugin for compiling C extensions
"cython", # Cython for compiling C extensions
"setuptools", # Setuptools for compiling C extensions
"cython", # Cython for compiling C extensions
"numpy", # NumPy for numerical operations and C extension includes
]

build-backend = "hatchling.build"

# Project metadata and configuration
@@ -62,10 +61,8 @@ dependencies = [
"webcolors"
]

# Indicates that the version is dynamically determined
dynamic = ["version"]

# Optional dependencies for testing
[project.optional-dependencies]
tests = [
"PyYAML",
@@ -75,56 +72,32 @@ tests = [
"mock"
]

# Project URLs
[project.urls]
homepage = "http://github.com/tanghaibao/jcvi"

# Hatch metadata configuration
[tool.hatch.metadata]
allow-direct-references = true

# Hatch build configuration
[tool.hatch.build]
source = "src" # Source directory
include = [
"src/jcvi/**", # Include all files in the jcvi directory
"README.md",
]
exclude = [
".github/*", # Exclude GitHub workflows and configurations
"docker/*", # Exclude Docker-related files
"tests/*", # Exclude test files
".*" # Exclude hidden files
]
packages = ["jcvi"]
source = "src"

# Hatch version configuration using VCS
[tool.hatch.version]
source = "vcs" # Use version control system for versioning
source = "vcs"

# Version file location for VCS
[tool.hatch.build.hooks.vcs]
version-file = "src/jcvi/version.py" # Path to write the version information
version-file = "src/jcvi/version.py"

# Version control system (VCS) versioning
[tool.hatch.version.vcs]
tag-pattern = "v*" # Git tags starting with 'v' will be used for versioning
tag-pattern = "v*"
fallback-version = "0.0.0"

# Cython build configuration
[tool.hatch.build.hooks.cython]
extensions = [
{name = "jcvi_assembly_chic", sources = ["src/jcvi/assembly/chic.pyx"], include-dirs = ["{numpy_include}"], extra-compile-args = ["-O3"]},
{name = "jcvi_formats_cblast", sources = ["src/jcvi/formats/cblast.pyx"], extra-compile-args = ["-O3"]}
]

[tool.hatch.build.targets.sdist]
include = [
"src/**",
"src/**/*.py",
"src/**/*.pyx",
"README.md",
]

[tool.hatch.build.targets.wheel]
include = [
"src/**",
"README.md",
]
packages = ["jcvi"]
26 changes: 26 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python

"""Package setup for Cython extensions only"""

from Cython.Build import build_ext
from setuptools import setup, Extension
import numpy as np

ext_modules = [
Extension(
"jcvi.assembly.chic",
["src/jcvi/assembly/chic.pyx"],
include_dirs=[np.get_include()],
extra_compile_args=["-O3"],
),
Extension(
"jcvi.formats.cblast",
["src/jcvi/formats/cblast.pyx"],
extra_compile_args=["-O3"]
),
]

setup(
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
)