Skip to content

Commit 17d50b3

Browse files
authored
Added conda support (#106)
* Create recipe * Updates appropriate installation files * Fixed installation and recipe files * Added bump version
1 parent 0c078af commit 17d50b3

4 files changed

Lines changed: 93 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ This will pull and install the latest stable release from [PyPI](https://pypi.or
5252
If you want to install from source or contribute to the project please read the
5353
[Contributing Guide](CONTRIBUTING.rst).
5454

55+
## Install with conda
56+
57+
**CTGAN** can also be installed using [conda](https://docs.conda.io/en/latest/):
58+
59+
```bash
60+
conda install -c sdv-dev -c conda-forge ctgan
61+
```
62+
63+
This will pull and install the latest stable release from [Anaconda](https://anaconda.org/).
64+
65+
5566
# Data Format
5667

5768
**CTGAN** expects the input data to be a table given as either a `numpy.ndarray` or a

conda/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Instructions
2+
3+
These are instructions to deploy the latest version of **CTGAN** to [conda](https://docs.conda.io/en/latest/).
4+
It should be done after every new release.
5+
6+
## Update the recipe
7+
Prior to making the release on PyPI, you should update the meta.yaml to reflect any changes in the dependencies.
8+
Note that you do not need to edit the version number as that is managed by bumpversion.
9+
10+
## Make the PyPI release
11+
Follow the standard release instructions to make a PyPI release. Then, return here to make the conda release.
12+
13+
## Build a package
14+
As part of the PyPI release, you will have updated the stable branch. You should now check out the stable
15+
branch and build the conda package.
16+
17+
```bash
18+
git checkout stable
19+
cd conda
20+
conda build -c pytorch .
21+
```
22+
23+
## Upload to Anaconda
24+
Finally, you can upload the resulting package to Anaconda.
25+
26+
```bash
27+
anaconda login
28+
anaconda upload -u sdv-dev <PATH_TO_PACKAGE>
29+
```

conda/meta.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{% set name = 'ctgan' %}
2+
{% set version = '0.2.3.dev0' %}
3+
4+
package:
5+
name: "{{ name|lower }}"
6+
version: "{{ version }}"
7+
8+
source:
9+
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
10+
11+
build:
12+
number: 0
13+
noarch: python
14+
entry_points:
15+
- ctgan=ctgan.__main__:main
16+
script: "{{ PYTHON }} -m pip install . -vv"
17+
18+
requirements:
19+
host:
20+
- numpy <2,>=1.17.4
21+
- pandas <2,>=0.24
22+
- pip
23+
- python
24+
- rdt >=0.2.7,<0.3
25+
- scikit-learn <0.24,>=0.21
26+
- pytorch <2,>=1.0
27+
- torchvision <1,>=0.4.2
28+
- pytest-runner
29+
run:
30+
- numpy <2,>=1.17.4
31+
- pandas <2,>=0.24
32+
- python
33+
- rdt >=0.2.7,<0.3
34+
- scikit-learn <0.24,>=0.21
35+
- pytorch <2,>=1.0
36+
- torchvision <1,>=0.4.2
37+
38+
about:
39+
home: "https://github.com/sdv-dev/CTGAN"
40+
license: MIT
41+
license_family: MIT
42+
license_file:
43+
summary: "Conditional GAN for Tabular Data"
44+
doc_url:
45+
dev_url:
46+
47+
extra:
48+
recipe-maintainers:
49+
- sdv-dev

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ replace = version='{new_version}'
2424
search = __version__ = '{current_version}'
2525
replace = __version__ = '{new_version}'
2626

27+
[bumpversion:file:conda/meta.yaml]
28+
search = version = '{current_version}'
29+
replace = version = '{new_version}'
30+
2731
[bdist_wheel]
2832
universal = 1
2933

0 commit comments

Comments
 (0)