Skip to content

Commit

Permalink
Add space before specifier (#5)
Browse files Browse the repository at this point in the history
* fix specifier

* fix specifier
  • Loading branch information
Gaurav Sheni authored Sep 1, 2022
1 parent cf95620 commit b376cda
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
21 changes: 17 additions & 4 deletions create_feedstock_meta_yaml/create_feedstock_meta_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,29 @@ def clean_reqs(reqs):
if len(req) > 1:
package = Requirement(req)
pypi_name = package.name
# import pdb;pdb.set_trace();
if pypi_name in pypi_to_conda:
pypi_name = pypi_to_conda.get(pypi_name) + str(package.specifier)
pypi_name = create_pypi_name(
pypi_to_conda.get(pypi_name),
package.specifier,
)
else:
pypi_name = package.name + str(package.specifier)
pypi_name = pypi_name.replace(">=", " >=")
pypi_name = create_pypi_name(package.name, package.specifier)
new_reqs.append(pypi_name)
return new_reqs


def create_pypi_name(package_name, specifier):
pypi_name = package_name
specs = [str(x) for x in specifier]
specs.sort()
for idx, x in enumerate(specs):
if idx == 0:
pypi_name += " " + str(x)
else:
pypi_name += ", " + str(x)
return pypi_name


def clean_cfg_section(section):
section = section.split("\n")
cleaned = clean_reqs(section)
Expand Down
2 changes: 1 addition & 1 deletion create_feedstock_meta_yaml/expected_meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requirements:
- distributed >=2021.10.0
- holidays >=0.13
- numpy >=1.21.0
- pandas >=1.3.0
- pandas !=1.4.2, >=1.4.0
- psutil >=5.6.6
- python >=3.7.*
- scipy >=1.3.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def verify_cmeta(cmeta, pypi_version):
"distributed >=2021.10.0",
"holidays >=0.13",
"numpy >=1.21.0",
"pandas >=1.3.0",
"pandas !=1.4.2, >=1.4.0",
"psutil >=5.6.6",
"python >=3.7.*",
"scipy >=1.3.3",
Expand Down
2 changes: 1 addition & 1 deletion create_feedstock_meta_yaml/test_pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
"distributed >= 2021.10.0",
"holidays >= 0.13",
"numpy >= 1.21.0",
"pandas >= 1.3.0",
"pandas >= 1.4.0, != 1.4.2",
"psutil >= 5.6.6",
"scipy >= 1.3.3",
"tqdm >= 4.32.0",
Expand Down
4 changes: 2 additions & 2 deletions create_feedstock_meta_yaml/test_setup.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[options]
python_requires = >=3.8, <4
install_requires =
click >= 7.0.0
cloudpickle >= 1.5.0
dask[dataframe] >= 2021.10.0
distributed >= 2021.10.0
holidays >= 0.13
numpy >= 1.21.0
pandas >= 1.3.0
pandas >= 1.4.0, != 1.4.2
psutil >= 5.6.6
scipy >= 1.3.3
tqdm >= 4.32.0
woodwork >= 0.16.2
python_requires = >=3.8, <4

[options.extras_require]
test =
Expand Down

0 comments on commit b376cda

Please sign in to comment.