Skip to content

Commit 3d51659

Browse files
authored
update contributing
* Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md
1 parent 6c2c0a4 commit 3d51659

File tree

1 file changed

+61
-5
lines changed

1 file changed

+61
-5
lines changed

CONTRIBUTING.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,70 @@
11
## Testing locally
22

3-
To test your contribution locally from the command line, run the Python script in the following format:
3+
To test your contribution locally from the command line, clone the repository and create a `repo` helper folder with files to upload:
44

55
```
6-
python dataverse.py DATAVERSE_TOKEN DATAVERSE_SERVER DATASET_DOI REPO_NAME
6+
git clone https://github.com/IQSS/dataverse-uploader.git
7+
cd dataverse-uploader
8+
mkdir repo # here store test folders and files for upload
79
```
10+
### Set up the environment
811

9-
Example:
12+
Next, install the necessary dependencies:
13+
14+
```
15+
python3 -m venv env
16+
source env/bin/activate
17+
python3 -m pip install -r requirements.txt
18+
```
19+
20+
Now, the folder should look like this:
1021
```
11-
python dataverse.py 9s3-7d46-hd https://demo.dataverse.org/ doi:10.70122/FK2/LVUADQ user/my-repo
22+
$ ls
23+
CONTRIBUTING.md README.md dataverse.py repo
24+
LICENSE action.yml env requirements.txt
1225
```
1326

14-
You can append this command with optional arguments such as `--dir data --remove False --publish True`
27+
### Testing commands
28+
29+
Run the Python script in the following format:
30+
31+
```
32+
python dataverse.py DATAVERSE_TOKEN DATAVERSE_SERVER DATASET_DOI REPO_NAME -p TRUE
33+
```
34+
35+
- `DATAVERSE_TOKEN` - dataverse token should be a valid token
36+
- `DATAVERSE_SERVER` - for testing use https://demo.dataverse.org/
37+
- `DATASET_DOI` - it should be a valid PID from Dataverse demo or a Dataverse instalation
38+
- `REPO_NAME` - for the local test, this is a **mock GitHub repository name**, and it should be a string, such as "user/my-repo" or similar
39+
40+
The script will upload everything from **the helper `repo` folder** to the `DATAVERSE_SERVER` at dataset `DATASET_DOI`.
41+
42+
### Examples
43+
44+
- The basic format of the command will upload and publish everything from the helper `repo` folder.
45+
46+
```
47+
python dataverse.py 9s3-7d46-hd https://demo.dataverse.org/ doi:10.70122/FK2/LVUADQ user/my-repo -p TRUE
48+
```
49+
50+
- To upload files from a single folder, use:
51+
52+
```
53+
python dataverse.py 9s3-7d46-hd https://demo.dataverse.org/ doi:10.70122/FK2/LVUADQ user/my-repo -d first_dir -p TRUE
54+
```
55+
56+
There needs to be a folder named `first_dir` that contains files inside the helper `repo` folder.
57+
58+
- To upload multiple folders, use the command:
59+
60+
```
61+
python dataverse.py 9s3-7d46-hd https://demo.dataverse.org/ doi:10.70122/FK2/LVUADQ user/my-repo -d first_dir,second_dir,third_dir -p TRUE
62+
```
63+
64+
The multiple directories with files need to be stored inside the helper `repo` folder.
65+
66+
- You can append this command with optional arguments such as `--remove/-r False` and `--publish/-p True`:
67+
68+
```
69+
python dataverse.py 9s3-7d46-hd https://demo.dataverse.org/ doi:10.70122/FK2/LVUADQ user/my-repo -r False -p True
70+
```

0 commit comments

Comments
 (0)