-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from setuptools-rust to maturin (#158)
* Make the project compatible with maturin * Build armv7l wheels with maturin-action * Update to `actions/checkout@v3` * Update to `actions/cache@v3` * Build abi3 wheels * Switch from setuptools-rust to maturin * Automate updating package version on tagged release * update set_version.py Co-authored-by: Samuel Colvin <[email protected]>
- Loading branch information
1 parent
3621931
commit 9bee15c
Showing
11 changed files
with
150 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import re | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def main(cargo_path_env_var='CARGO_PATH', version_env_vars=('VERSION', 'GITHUB_REF')) -> int: | ||
cargo_path = os.getenv(cargo_path_env_var, 'Cargo.toml') | ||
cargo_path = Path(cargo_path) | ||
if not cargo_path.is_file(): | ||
print(f'✖ path "{cargo_path}" does not exist') | ||
return 1 | ||
|
||
version = None | ||
for var in version_env_vars: | ||
version_ref = os.getenv(var) | ||
if version_ref: | ||
version = re.sub('^refs/tags/v*', '', version_ref.lower()) | ||
break | ||
if not version: | ||
print(f'✖ "{version_env_vars}" env variables not found') | ||
return 1 | ||
|
||
print(f'writing version "{version}", to {cargo_path}') | ||
|
||
version_regex = re.compile('^version ?= ?".*"', re.M) | ||
cargo_content = cargo_path.read_text() | ||
if not version_regex.search(cargo_content): | ||
print(f'✖ {version_regex!r} not found in {cargo_path}') | ||
return 1 | ||
|
||
new_content = version_regex.sub(f'version = "{version}"', cargo_content) | ||
cargo_path.write_text(new_content) | ||
return 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
[package] | ||
name = "watchfiles_rust_notify" | ||
version = "1.0.0" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
crossbeam-channel = "0.5.4" | ||
notify = "=5.0.0-pre.15" | ||
pyo3 = {version = "0.16.4", features = ["extension-module"]} | ||
pyo3 = {version = "0.16.4", features = ["extension-module", "abi3-py37"]} | ||
|
||
[lib] | ||
name = "_rust_notify" | ||
crate-type = ["cdylib"] | ||
|
||
[package.metadata.maturin] | ||
name = "watchfiles._rust_notify" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,51 @@ | ||
[build-system] | ||
requires = ['setuptools', 'setuptools-rust'] | ||
requires = ['maturin>=0.12,<0.13'] | ||
build-backend = 'maturin' | ||
|
||
[project] | ||
name = 'watchfiles' | ||
requires-python = '>=3.7' | ||
description = 'Simple, modern and high performance file watching and code reload in python.' | ||
authors = [ | ||
{name ='Samuel Colvin', email = '[email protected]'}, | ||
] | ||
dependencies = [ | ||
'anyio>=3.0.0,<4', | ||
] | ||
classifiers = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Console', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Information Technology', | ||
'Intended Audience :: System Administrators', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: MacOS', | ||
'Environment :: MacOS X', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Topic :: System :: Filesystems', | ||
'Framework :: AnyIO', | ||
] | ||
dynamic = [ | ||
"license", | ||
"readme", | ||
"version" | ||
] | ||
[project.scripts] | ||
watchfiles = 'watchfiles.cli:cli' | ||
[project.urls] | ||
Documentation = 'https://watchfiles.helpmanual.io' | ||
Funding = 'https://github.com/sponsors/samuelcolvin' | ||
Source = 'https://github.com/samuelcolvin/watchfiles' | ||
Changelog = 'https://github.com/samuelcolvin/watchfiles/releases' | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = 'tests' | ||
|
Oops, something went wrong.