Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pyfa-org/Pyfa
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFenX committed Nov 7, 2019
2 parents e6cfd33 + c29126c commit f48483d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
39 changes: 31 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- Python 3.6
- Git CLI installed
- Python, pip and git are all available as command-line commands (add to path if needed)
- Python, pip and git are all available as command-line commands (add to the path if needed)

Virtual environment will be created in *PyfaEnv* folder. Project will be cloned and run from the *PyfaDEV* folder. Separate virtual environment will be created so required libraries won't clutter the main python installation.

Expand All @@ -17,16 +17,16 @@ Clone the repository
git clone <repo> PyfaDEV
```

Create virtual environment
Create the virtual environment
```
python -m venv PyfaEnv
```

Activate virtual environment
Activate the virtual environment

```
For cmd.exe: PyfaEnv\scripts\activate.bat
For bash: source <venv>/bin/activate
For bash: source <venv>/Scripts/activate
```
> For other OS check [Python documentation](https://docs.python.org/3/library/venv.html)
Expand All @@ -52,11 +52,11 @@ python PyfaDEV\pyfa.py

Install PyCharm / Other IntelliJ product with Python plugin

After launching select *Check out from Version Control* -> *GIt*
After launching - select *Check out from Version Control* -> *GIt*

![welcome](https://user-images.githubusercontent.com/54093496/66862580-d8edab00-ef99-11e9-94e2-e93d7043e620.png)

Login to GitHub, paste repo URL and seect the folder to which to clone the project, press *Clone*.
Login to GitHub, paste the repo URL and select the folder to which to clone the project into, press *Clone*.

![Clone](https://user-images.githubusercontent.com/54093496/66862748-38e45180-ef9a-11e9-9f68-4903baf47385.png)

Expand All @@ -68,12 +68,35 @@ Press on options and add new virtual environment.

![venv](https://user-images.githubusercontent.com/54093496/66862833-67622c80-ef9a-11e9-94fa-47cca0158d29.png)

Open project tree view and double-click on *requirements.txt*. Press *Install requirements*. Install all requirements.
Open project tree view and double-click on the *requirements.txt*. Press *Install requirements*. Install all requirements.

![Reqs](https://user-images.githubusercontent.com/54093496/66862870-7a74fc80-ef9a-11e9-9b18-e64be42c49b8.png)

Create new *Run Configuration*. Set correct *Script path* and *Python interpreter*.

![Run configuraion](https://user-images.githubusercontent.com/54093496/66862970-b4460300-ef9a-11e9-9fb4-20e24759904b.png)

Test that the project is starting properly.
Check that the project is starting properly.

## Running tests

Switch to the proper virtual environment
```
For cmd.exe: PyfaEnv\scripts\activate.bat
For bash: source <venv>/Scripts/activate
```

Install pytest
```
pip install pytest
```

Switch to pyfa directory.

Run tests (any will do)
```
python -m pytest
py.test
```

More information on tests can be found on appropriate [Wiki page](https://github.com/pyfa-org/Pyfa/wiki/Developers:-Writing-Tests-for-Pyfa).
2 changes: 1 addition & 1 deletion service/marketSources/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = ['evemarketer', 'evemarketdata', 'evepraisal']
__all__ = ['evemarketer', 'evepraisal', 'evemarketdata']
4 changes: 4 additions & 0 deletions service/marketSources/evepraisal.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ def fetchPrices(priceMap, fetchTimeout, system=None):
try:
typeID = int(itemData['typeID'])
price = itemData['prices']['sell']['min']
orderCount = itemData['prices']['sell']['order_count']
except (KeyError, TypeError):
continue
# evepraisal returns 0 if price data doesn't even exist for the item
if price == 0:
continue
# evepraisal seems to provide price for some items despite having no orders up
if orderCount < 1:
continue
priceMap[typeID].update(PriceStatus.fetchSuccess, price)
del priceMap[typeID]

Expand Down

0 comments on commit f48483d

Please sign in to comment.