mirror of
https://github.com/mtshiba/pylyzer.git
synced 2025-08-04 14:28:24 +00:00
Update setup.py
This commit is contained in:
parent
bfdafa9965
commit
9e3df04786
1 changed files with 16 additions and 2 deletions
18
setup.py
18
setup.py
|
@ -1,3 +1,5 @@
|
|||
# To build the package, run `python -m build --wheel`.
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
import shlex
|
||||
|
@ -8,6 +10,18 @@ from setuptools import setup, Command
|
|||
from setuptools_rust import RustBin
|
||||
import tomli
|
||||
|
||||
def removeprefix(string, prefix):
|
||||
if string.startswith(prefix):
|
||||
return string[len(prefix):]
|
||||
else:
|
||||
return string
|
||||
|
||||
def removesuffix(string, suffix):
|
||||
if string.endswith(suffix):
|
||||
return string[:-len(suffix)]
|
||||
else:
|
||||
return string
|
||||
|
||||
class Clean(Command):
|
||||
user_options = []
|
||||
def initialize_options(self):
|
||||
|
@ -34,8 +48,8 @@ cargo_args = ["--no-default-features"]
|
|||
|
||||
home = os.path.expanduser("~")
|
||||
file_and_dirs = glob(home + "/" + ".erg/lib/**", recursive=True)
|
||||
paths = [Path(home + "/" + path) for path in file_and_dirs if os.path.isfile(home + "/" + path)]
|
||||
files = [(str(path).removesuffix("/" + path.name).removeprefix(home), str(path)) for path in paths]
|
||||
paths = [Path(path) for path in file_and_dirs if os.path.isfile(path)]
|
||||
files = [(removeprefix(removesuffix(str(path), "/" + path.name), home), str(path)) for path in paths]
|
||||
data_files = {}
|
||||
for key, value in files:
|
||||
if key in data_files:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue